Advertisement
Guest User

Non-metric graph paper in PostScript

a guest
Feb 3rd, 2016
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %!PS-Adobe-3.0
  2. %%BoundingBox: 0 0 612 792
  3. %%Title: (Traditional squared graph paper: GraphPaper0.ps)
  4. %%Creator: (PM 2Ring)
  5. %%Creationdate: (19:43:00 Apr  9 1999)
  6. %%Pages: 1 1
  7. %%EndComments
  8.  
  9. 16 dict begin
  10.  
  11. %Page size: US letter
  12. /XM 612 def
  13. /YM 792 def
  14.  
  15. %One inch in PostScript points
  16. /inch {72 mul}bind def        
  17.  
  18. %Bottom left margin
  19. /MARGIN .25 inch def
  20.  
  21. % Grid increments
  22. /dBig 1 inch def
  23. /dSmall .1 inch def
  24.  
  25. % Grid colour in HSB form
  26. /Colour {.5 1 1 } bind def  %Cyan
  27. /Colour {0 0 0.5 } bind def  %Gray
  28.  
  29. % ------------------------------------------------------------
  30.  
  31. %Grid size
  32. /XLO MARGIN def
  33. /YLO MARGIN def
  34.  
  35. /XR 8 inch def
  36. /YR 10 inch def
  37.  
  38. /XHI XLO XR add def
  39. /YHI YLO YR add def
  40.  
  41. % ------------------------------------------------------------
  42.  
  43. gsave
  44.     Colour sethsbcolor
  45.    
  46.     %Minor gridlines
  47.     .1 setlinewidth
  48.     %Uncomment one of the lines below to use dashed lines for the small squares
  49.     %[2 2] 0 setdash
  50.     [1 1] 0 setdash
  51.    
  52.     YLO dSmall YHI
  53.     {
  54.         XLO exch moveto
  55.         XR 0 rlineto stroke
  56.     } for
  57.    
  58.     XLO dSmall XHI
  59.     {
  60.         YLO moveto
  61.         0 YR rlineto stroke
  62.     } for
  63.    
  64.     %Major gridlines
  65.     .25 setlinewidth
  66.     [] 0 setdash
  67.    
  68.     YLO dBig YHI
  69.     {
  70.         XLO exch moveto
  71.         XR 0 rlineto stroke
  72.     } for
  73.    
  74.     XLO dBig XHI
  75.     {
  76.         YLO moveto
  77.         0 YR rlineto stroke
  78.     } for    
  79. grestore
  80. showpage
  81.  
  82. end
  83. %%EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement