Guest User

Troff challenge 2

a guest
Mar 2nd, 2021
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. .ps 15
  2. .fam H
  3. .sp 2
  4. .PS 6.5
  5. linethick = 0.8
  6. # re-create this invisible box at the end to fix the z-index
  7. B: box at (0, 0) width 70 height 50 invis
  8.  
  9. # y labels
  10. for i = 0 to 50 by 5 do {
  11. sprintf("%.0f", i) at B.sw + (-4, i)
  12. }
  13. # create vertical text by drawing an invisible vertical line
  14. line invis from B.sw - (10, 0) to B.nw - (10, 0) "Post Count" aligned
  15.  
  16. # y ticks
  17. for i = 5 to 49 by 5 do {
  18. line from B.sw + (0, i) to B.sw + ( 0.5, i)
  19. line from B.se + (0, i) to B.se + (-0.5, i)
  20. }
  21.  
  22. "Month Name" at B.s - (0, 8)
  23. "Open Mic Posts Per Month in NJ CL Sections" at B.n + (0, 4)
  24.  
  25. copy thru { $1 at B.sw + ($2, -3) } until "END"
  26. "September" 0
  27. "October" 14
  28. "November" 28
  29. "December" 42
  30. "January" 56
  31. "February" 70
  32. END
  33. # x ticks
  34. for i = 14 to 69 by 14 do {
  35. line from B.sw + (i, 0) to B.sw + (i, 0.5)
  36. line from B.nw + (i, 0) to B.nw + (i, -0.5)
  37. }
  38.  
  39. move to B.sw + (0, 1)
  40. define datapoint {
  41. line to B.sw + ($1, $2) color "red";
  42. move up 0.4
  43. line down 0.8 color "red"
  44. move up 0.4
  45. move left 0.4
  46. line right 0.8 color "red"
  47. move left 0.4
  48. }
  49. datapoint( 0, 1)
  50. datapoint(14, 23)
  51. datapoint(28, 31)
  52. datapoint(42, 42)
  53. datapoint(56, 32)
  54. datapoint(70, 47)
  55.  
  56. box at (0, 0) width B.width height B.height
  57. .PE
  58.  
Advertisement
Add Comment
Please, Sign In to add comment