iplot.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* Plotting functions for v8 and v9 systems */
  2. /* This file is an alternative to plot.h */
  3. /* open the plotting output */
  4. #define openpl() print("o\n")
  5. /* close the plotting output */
  6. #define closepl() print("cl\n")
  7. /* make sure the page or screen is clear */
  8. #define erase() print("e\n")
  9. /* plot a point at _x,_y, which becomes current */
  10. #define point(_x,_y) print("poi %d %d\n", _x,_y)
  11. /* coordinates to be assigned to lower left and upper right
  12. corners of (square) plotting area */
  13. #define range(_x,_y,_X,_Y) print("ra %d %d %d %d\n", _x,_y,_X,_Y)
  14. /* place text, first letter at current point, which does not change */
  15. #define text(_s) {if(*(_s) == ' ')print("t \"%s\"\n",_s); else print("t %s\n", _s); }
  16. /* draw line from current point to _x,_y, which becomes current */
  17. #define vec(_x,_y) print("v %d %d\n", _x,_y)
  18. /* _x,_y becomes current point */
  19. #define move(_x, _y) print("m %d %d\n", _x, _y)
  20. /* specify style for drawing lines */
  21. #define SOLID "solid"
  22. #define DOTTED "dotted"
  23. #define DASHED "dashed"
  24. #define DOTDASH "dotdash"
  25. #define pen(_s) print("pe %s\n", _s)
  26. #define BLACK "z"
  27. #define RED "r"
  28. #define YELLOW "y"
  29. #define GREEN "g"
  30. #define BLUE "b"
  31. #define CYAN "c"
  32. #define MAGENTA "m"
  33. #define WHITE "w"
  34. #define colorcode(_s) ((strcmp(_s,"black")==0)?BLACK:_s)
  35. #define colorx(_s) print("co %s\n", _s); /* funny name is all ken's fault */
  36. #define comment(s,f)