home *** CD-ROM | disk | FTP | other *** search
- /*
- * gpp
- *
- * Graph plotting programme.
- *
- */
- #ifdef SGI_GL
- #include "gl.h"
- #include "device.h"
- #else
- #include "vogl.h"
- #include "vodevice.h"
- #endif
- #include "gpp.h"
-
- /*
- * main driver
- */
- main(argc, argv)
- int argc;
- char **argv;
- {
- int i;
- char cm[2];
- graph *p;
-
- short val;
- Screencoord left, right, bottom, top;
-
- doargs(argc, argv);
-
- /*vinit(device);*/
- prefsize(1000, 750);
- winopen("GPP");
- qdevice(KEYBD);
-
- /*
- * Zap initial REDRAW
- */
-
- qread(&val);
-
- reshapeviewport();
- color(BLACK);
- clear();
-
- pushviewport();
-
- getviewport(&left, &right, &bottom, &top);
-
- /* It's supposed to be 4:3 ratio ... */
- viewport(left,
- right - (short)(0.25 * (right - left)),
- bottom,
- top - (short)(0.05 * (top - bottom)));
-
-
- color(WHITE);
-
- if (fontname[0])
- hfont(fontname);
- else
- hfont("futura.l");
-
- readgraphs();
-
- if (!uxscale || !uyscale /* || !uzscale */)
- for (p = gp; p != (graph *)NULL; p = p->nxt) {
- if (!uxscale)
- adjustscale(p->x, p->npnts, 'x');
-
- if (!uyscale)
- adjustscale(p->y, p->npnts, 'y');
-
- /*if (!uzscale)
- adjustscale(p->z, p->npnts, 'z');*/
- }
-
- axistitle(xlabel, 'x');
- axistitle(ylabel, 'y');
- /*axistitle(zlabel, 'z');*/
-
- drawaxes2();
- drawtitle();
-
- i = 0;
- cm[1] = '\0';
-
- hfont("markers");
-
- linewidth(2);
- for (p = gp; p != (graph *)NULL; p = p->nxt) {
- color((i % 7) + 1);
- cm[0] = 'a' + (i++);
- marker(cm);
- plot2(p->x, p->y, p->npnts);
- }
-
- linewidth(1);
-
- popviewport();
- if (do_legend)
- drawlegend();
-
-
- qread(&val);
-
- gexit();
- }
-