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