summaryrefslogtreecommitdiff
path: root/graphics/psfig/unsupported/graphpaper.ps
blob: 031061afb28422a75aa06b19f9b611f4fda6d52b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
%!

/emptystr { (      ) } def
/graph {
	/labels exch def % show labels ? (boolean)
	/divs exch def	% divsion spacing
	/height exch def
	/width exch def

	.25 setlinewidth
	2 setlinecap
	gsave 
%	currentlinewidth currentdash
%	initgraphics
%	setdash setlinewidth
	
	width divs div cvi
	/index divs def
	divs 0 translate
	
	    { newpath  
		0 0 moveto   
		labels {
			gsave 
			90 rotate 20 0 moveto
			index emptystr cvs show
			grestore
		} if
		0 height lineto
	      stroke   
	      divs 0 translate
	      /index index divs add def
	
	    } repeat 

	grestore
	gsave	
%	currentlinewidth currentdash
%	initgraphics
%	setdash setlinewidth

	height divs div cvi
	/index divs def
	0 divs translate
	
	    { newpath  
		0 0 moveto   
		labels {
			gsave
			20 0 moveto
			index emptystr cvs show
			grestore
		} if
		width 0 lineto
	      stroke   
	      0 divs translate
	      /index index divs add def
	
	    } repeat 
	
	grestore

} def

save 

/Helvetica findfont 10 scalefont setfont
/inch {72 mul} def

1 setlinewidth
8.5 inch 11 inch 100 true graph 
[3] 0 setdash
.25 setlinewidth
8.5 inch 11 inch 20 false graph

restore

showpage