aboutsummaryrefslogtreecommitdiffstats
path: root/include/graphf.lpg
diff options
context:
space:
mode:
authorJeffrey H. Kingston <jeff@it.usyd.edu.au>2010-09-14 20:39:13 +0000
committerJeffrey H. Kingston <jeff@it.usyd.edu.au>2010-09-14 20:39:13 +0000
commitb2f1a4e879d3013974e41674dbf684d816f1aa95 (patch)
tree08292d39f5b0592c01946a2a754a93329ef599d3 /include/graphf.lpg
parent7d292f1247e3287fb07a9a12377217ce8942cf09 (diff)
downloadlout-b2f1a4e879d3013974e41674dbf684d816f1aa95.tar.gz
Lout 3.30.
git-svn-id: http://svn.savannah.nongnu.org/svn/lout/trunk@29 9365b830-b601-4143-9ba8-b4a8e2c3339c
Diffstat (limited to 'include/graphf.lpg')
-rw-r--r--include/graphf.lpg25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/graphf.lpg b/include/graphf.lpg
index 5546586..f85dc77 100644
--- a/include/graphf.lpg
+++ b/include/graphf.lpg
@@ -534,6 +534,14 @@ lgraphdict begin
0 xticklength neg rlineto [] 0 setdash stroke
} def
+% printxgrid: print one x grid line
+% xpos printxgrid -
+/printxgrid
+{ dup newpath
+ yleft trpoint moveto 0 yextra neg rmoveto
+ yright trpoint lineto 0 yextra rlineto [] 0 setdash stroke
+} def
+
% printxlabel: print one x label
% (xlabel) xpos printxlabel -
/printxlabel
@@ -551,6 +559,14 @@ lgraphdict begin
yticklength neg 0 rlineto [] 0 setdash stroke
} def
+% printygrid: print one y grid line
+% ypos printygrid -
+/printygrid
+{ dup newpath
+ xleft exch trpoint moveto xextra neg 0 rmoveto
+ xright exch trpoint lineto xextra 0 rlineto [] 0 setdash stroke
+} def
+
% printylabel: print one y label
% (ylabel) ypos printylabel -
/printylabel
@@ -825,6 +841,15 @@ lgraphdict begin
/printrtick /printrlabel rticks ymin printticks
} def
+% gridstyle: print a frame around the graph, plus a grid
+/gridstyle
+{ 0 0 moveto xsize 0 lineto xsize ysize lineto
+ 0 ysize lineto closepath stroke
+ /printxgrid /printxlabel xticks xleft printticks
+ /printygrid /printylabel yticks ymin printticks
+ /printrtick /printrlabel rticks ymin printticks
+} def
+
% nonestyle: print nothing around the graph
/nonestyle
{