aboutsummaryrefslogtreecommitdiffstats
path: root/include/graphf.lpg
diff options
context:
space:
mode:
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
{