home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-10-22 | 49.9 KB | 1,864 lines |
- *** ../work/README Tue Oct 8 17:36:09 1991
- --- README Tue Oct 8 16:55:20 1991
- ***************
- *** 1,3 ****
- --- 1,5 ----
- + $Revision: 6.0 $
- +
- Jgraph takes the description of a graph or graphs in the standard
- input, and produces a postscript file on the standard output. Jgraph
- is ideal for plotting any mixture of scatter point graphs, line
- ***************
- *** 8,14 ****
- graphs with a minimum of effort, yet powerful enough to give the user
- the flexibility to tailor the appearance of the graph to his or her
- individual preferences. This includes plotting multiple graphs and
- ! laying them out separately on the page.
-
- The program is written in C, and shouldn't take anything too fancy
- or machine-dependent. It has been tested on VAX mipsel's and mipseb's,
- --- 10,16 ----
- graphs with a minimum of effort, yet powerful enough to give the user
- the flexibility to tailor the appearance of the graph to his or her
- individual preferences. This includes plotting multiple graphs and
- ! laying them out separately on the page (or pages).
-
- The program is written in C, and shouldn't take anything too fancy
- or machine-dependent. It has been tested on VAX mipsel's and mipseb's,
- ***************
- *** 17,22 ****
- --- 19,32 ----
- There is a makefile, a man page (in jgraph.1), source code, and
- example graphs.
-
- + Jgraph is available via anonymous ftp to princeton.edu, in the
- + file jgraph.Z. This file is a compressed shell bundle file.
- +
- + There is also a mailing list in which I inform users directly
- + about bug fixes. This is for those who don't read comp.sources.misc,
- + or those who would like to hear about minor bug fixes which I
- + haven't posted as a patch to comp.sources.misc.
- +
- Please send me comments and/or bug reports.
-
- Author: Jim Plank
- ***************
- *** 24,31 ****
- USmail: Department of Computer Science
- Princeton University
- 35 Olden St.
- ! Princeton, Nj 08544-2087
- !
- !
- !
- !
- --- 34,37 ----
- USmail: Department of Computer Science
- Princeton University
- 35 Olden St.
- ! Princeton, NJ 08544-2087
- *** ../work/descrip.mms Tue Oct 8 17:36:10 1991
- --- descrip.mms Tue Oct 8 16:55:13 1991
- ***************
- *** 1,10 ****
- ! CC = cc
- !
- .ifdef DEBUG
- ! CFLAGS=/noopt/debug
- LFLAGS=/debug
- .else
- ! CFLAGS=
- LFLAGS=
- .endif
-
- --- 1,15 ----
- ! # VMS MMS makefile
- ! #
- ! # In the link you will get a warning because of the multiple definition
- ! # of exit(). This may be ignored; in order to get MMS completing without
- ! # trouble you will have to call MMS as follows:
- ! # $ MMS/IGNORE
- ! #
- .ifdef DEBUG
- ! CFLAGS=/INCLUDE=(SYS$DISK:[],SYS$SHARE:)/noopt/debug
- LFLAGS=/debug
- .else
- ! CFLAGS=/INCLUDE=(SYS$DISK:[],SYS$SHARE:)
- LFLAGS=
- .endif
-
- ***************
- *** 16,36 ****
- prio_list.obj, \
- process.obj, \
- show.obj, \
- ! token.obj
-
- all : jgraph.exe
- ! done
-
- ! .SUFFIXES : .jgr .jps .tex .dvi
- !
- ! .jgr.jps :
- ! jgraph < $*.jgr > *.jps
- !
- ! .tex.dvi :
- ! latex $*.tex
- !
- jgraph.exe : $(OBJS)
- ! link $(LFLAGS) /exe=jgraph $(OBJS)
-
- ###
- draw.obj : draw.c jgraph.h list.h prio_list.h
- --- 21,37 ----
- prio_list.obj, \
- process.obj, \
- show.obj, \
- ! token.obj, \
- ! exit.obj
-
- all : jgraph.exe
- ! done
-
- ! # Do not link against the shareable image VAXCRTL.EXE, or you will
- ! # miss the reference to the local exit() routine.
- ! # EXIT will be reported as being multiply defined - ignore that.
- jgraph.exe : $(OBJS)
- ! link $(LFLAGS) /exe=jgraph $(OBJS),sys$library:vaxcrtl/libr
-
- ###
- draw.obj : draw.c jgraph.h list.h prio_list.h
- ***************
- *** 42,44 ****
- --- 43,46 ----
- process.obj : process.c jgraph.h list.h prio_list.h
- show.obj : show.c jgraph.h list.h prio_list.h
- token.obj : token.c list.h
- + exit.obj : exit.c
- *** ../work/draw.c Tue Oct 8 17:36:11 1991
- --- draw.c Tue Oct 8 16:55:14 1991
- ***************
- *** 1,7 ****
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/draw.c,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:45:08 $
- * $Author: jsp $
- */
-
- --- 1,7 ----
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/draw.c,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:43 $
- * $Author: jsp $
- */
-
- ***************
- *** 46,53 ****
-
- #define MAXIMUM(a,b) ((a > b) ? a : b)
-
- ! draw_axis(a)
- ! Axis a;
- {
- char orientation;
- Hash h;
- --- 46,53 ----
-
- #define MAXIMUM(a,b) ((a > b) ? a : b)
-
- ! draw_axis(a, other)
- ! Axis a, other;
- {
- char orientation;
- Hash h;
- ***************
- *** 57,70 ****
- setlinewidth(1.0);
- if (a->draw_axis_line) {
- comment("Drawing Axis");
- printline(0.0, a->draw_at, a->psize, a->draw_at, orientation);
- }
- if (a->draw_hash_marks) {
- comment("Drawing Hash Marks");
- for (h = first(a->hash_lines); h != nil(a->hash_lines); h = next(h)) {
- ! printline(h->loc,
- ! a->draw_hash_marks_at,
- ! h->loc,
- a->draw_hash_marks_at + (h->size * a->hash_scale),
- orientation);
- }
- --- 57,69 ----
- setlinewidth(1.0);
- if (a->draw_axis_line) {
- comment("Drawing Axis");
- + printf("gsave %f setgray\n", a->gray);
- printline(0.0, a->draw_at, a->psize, a->draw_at, orientation);
- }
- if (a->draw_hash_marks) {
- comment("Drawing Hash Marks");
- for (h = first(a->hash_lines); h != nil(a->hash_lines); h = next(h)) {
- ! printline(h->loc, a->draw_hash_marks_at, h->loc,
- a->draw_hash_marks_at + (h->size * a->hash_scale),
- orientation);
- }
- ***************
- *** 81,90 ****
- --- 80,95 ----
- draw_label(a->hl);
- }
- }
- + if (a->grid_lines) {
- + for (h = first(a->hash_lines); h != nil(a->hash_lines); h = next(h)) {
- + printline(h->loc, 0.0, h->loc, other->psize, orientation);
- + }
- + }
- if (a->draw_axis_label) {
- comment("Drawing Axis Label");
- draw_label(a->label);
- }
- + printf(" grestore\n");
- }
-
-
- ***************
- *** 96,109 ****
- --- 101,128 ----
- print_text(l->label, l->x, l->y, l->hj, l->vj, l->rotate, l->font, l->fontsize);
- }
-
- + set_clip(g)
- + Graph g;
- + {
- + comment("Setting Clip");
- + printf("newpath\n");
- + printf(" 0 0 moveto 0 %f lineto %f %f lineto %f 0 lineto\n",
- + g->y_axis->psize, g->x_axis->psize,
- + g->y_axis->psize, g->x_axis->psize);
- + printf(" closepath clip newpath\n");
- + }
- +
- draw_curves(g)
- Graph g;
- {
- Curve c;
-
- + printf("gsave\n");
- + if (g->clip) set_clip(g);
- for(c = first(g->curves); c != nil(g->curves); c = next(c)) {
- draw_curve(c, g);
- }
- + printf(" grestore\n");
- }
-
- draw_curve(c, g)
- ***************
- *** 112,128 ****
- {
- Point p;
- int i;
-
- if (c->linetype != '0') {
- - comment("Drawing Curve Lines");
- -
- i = 0;
- for (p = first(c->pts);
- p != nil(c->pts);
- p = next(p)) {
- if (i == 0) {
- ! start_line(ctop(p->x, g->x_axis), ctop(p->y, g->y_axis),
- ! c->linethick, c->linetype);
- } else {
- cont_line(ctop(p->x, g->x_axis), ctop(p->y, g->y_axis));
- }
- --- 131,148 ----
- {
- Point p;
- int i;
- + float this_x, this_y, last_x, last_y;
-
- + printf("gsave %f setgray\n", c->gray);
- + if (c->clip) set_clip(g);
- + comment("Drawing Curve");
- if (c->linetype != '0') {
- i = 0;
- for (p = first(c->pts);
- p != nil(c->pts);
- p = next(p)) {
- if (i == 0) {
- ! start_line(ctop(p->x, g->x_axis), ctop(p->y, g->y_axis), c);
- } else {
- cont_line(ctop(p->x, g->x_axis), ctop(p->y, g->y_axis));
- }
- ***************
- *** 138,145 ****
- for (p = first(c->pts);
- p != nil(c->pts);
- p = next(p)) {
- ! draw_mark(ctop(p->x, g->x_axis), ctop(p->y, g->y_axis), c, g);
- }
- }
-
- draw_mark(x, y, c, g)
- --- 158,176 ----
- for (p = first(c->pts);
- p != nil(c->pts);
- p = next(p)) {
- ! this_x = ctop(p->x, g->x_axis);
- ! this_y = ctop(p->y, g->y_axis);
- ! draw_mark(this_x, this_y, c, g);
- ! if (p != first(c->pts)) {
- ! if (c->rarrows)
- ! draw_arrow(this_x, this_y, last_x, last_y, c);
- ! if (c->larrows)
- ! draw_arrow(last_x, last_y, this_x, this_y, c);
- }
- + last_x = this_x;
- + last_y = this_y;
- + }
- + printf(" grestore\n");
- }
-
- draw_mark(x, y, c, g)
- ***************
- *** 208,213 ****
- --- 239,261 ----
- }
- }
-
- + draw_arrow(x1, y1, x2, y2, c)
- + float x1, y1, x2, y2;
- + Curve c;
- + {
- + float dx, dy;
- +
- + dx = x1 - x2;
- + dy = y1 - y2;
- + if (dx == 0.0 && dy == 0.0) return;
- + printf("gsave %f %f translate %f %f atan rotate\n", x1, y1, dy, dx);
- + start_poly(0.0, 0.0);
- + cont_poly(-(c->asize[0]), (c->asize[1]));
- + cont_poly(-(c->asize[0]), -(c->asize[1]));
- + end_poly(c->fill);
- + printf(" grestore\n");
- + }
- +
- draw_legend(g)
- Graph g;
- {
- ***************
- *** 220,233 ****
- if (l->type == 'n') return;
- for (c = first(g->curves); c != nil(g->curves); c = next(c)) {
- if (c->l->label != CNULL) {
- y = c->l->y - (c->l->fontsize / 2.0 * FCPI / FPPI);
- if (l->anylines) {
- ! if (c->linetype != '0') {
- x = c->l->x - l->midspace - l->linelength;
- ! start_line(x, y, c->linethick, c->linetype);
- cont_line(x+l->linelength, y);
- end_line();
- }
- x = c->l->x - l->midspace - l->linelength / 2.0;
- } else x = c->l->x - l->midspace;
- if (c->marktype == 'X' || c->marktype == 'Y') {
- --- 268,284 ----
- if (l->type == 'n') return;
- for (c = first(g->curves); c != nil(g->curves); c = next(c)) {
- if (c->l->label != CNULL) {
- + printf("gsave %f setgray\n", c->gray);
- y = c->l->y - (c->l->fontsize / 2.0 * FCPI / FPPI);
- if (l->anylines) {
- ! if (c->linetype != '0' && l->linelength != 0) {
- x = c->l->x - l->midspace - l->linelength;
- ! start_line(x, y, c);
- cont_line(x+l->linelength, y);
- end_line();
- }
- + if (c->larrows) draw_arrow(x, y, x+l->linelength, y, c);
- + if (c->rarrows) draw_arrow(x+l->linelength, y, x, y, c);
- x = c->l->x - l->midspace - l->linelength / 2.0;
- } else x = c->l->x - l->midspace;
- if (c->marktype == 'X' || c->marktype == 'Y') {
- ***************
- *** 239,244 ****
- --- 290,296 ----
- } else {
- draw_mark(x, y, c, g);
- }
- + printf("grestore\n");
- draw_label(c->l);
- }
- }
- ***************
- *** 260,267 ****
- comment("Drawing New Graph");
- printf("%f %f translate\n", g->x_translate - g->x_axis->psize / 2.0,
- g->y_translate);
- ! draw_axis(g->x_axis);
- ! draw_axis(g->y_axis);
- draw_label(g->title);
- draw_curves(g);
- draw_legend(g);
- --- 312,325 ----
- comment("Drawing New Graph");
- printf("%f %f translate\n", g->x_translate - g->x_axis->psize / 2.0,
- g->y_translate);
- ! if (g->border) {
- ! printline(0.0, 0.0, 0.0, g->y_axis->psize, 'x');
- ! printline(0.0, 0.0, 0.0, g->x_axis->psize, 'y');
- ! printline(g->x_axis->psize, 0.0, g->x_axis->psize, g->y_axis->psize, 'x');
- ! printline(g->y_axis->psize, 0.0, g->y_axis->psize, g->x_axis->psize, 'y');
- ! }
- ! draw_axis(g->x_axis, g->y_axis);
- ! draw_axis(g->y_axis, g->x_axis);
- draw_label(g->title);
- draw_curves(g);
- draw_legend(g);
- ***************
- *** 271,292 ****
-
- }
-
- ! draw_graphs(gs)
- Graphs gs;
- {
- Graph g;
-
- ! draw_header(gs);
- ! for (g = first(gs->g); g != nil(gs->g); g = next(g)) {
- ! draw_graph(g);
- }
- - draw_footer(gs);
- }
-
- ! draw_header(gs)
- Graphs gs;
- {
- ! printf("%%!\n");
- printf("%%%%Pages: 0\n");
- printf("%%%%BoundingBox: %f %f %f %f\n", gs->bb[0], gs->bb[1], gs->bb[2], gs->bb[3]);
- printf("%%%%EndComments\n");
- --- 329,355 ----
-
- }
-
- ! draw_graphs(gs, pp)
- Graphs gs;
- + int pp;
- {
- + Graphs gs_p;
- Graph g;
-
- ! for (gs_p = first(gs); gs_p != nil(gs); gs_p = next(gs_p)) {
- ! draw_header(gs_p, pp);
- ! for (g = first(gs_p->g); g != nil(gs_p->g); g = next(g)) {
- ! draw_graph(g);
- ! }
- ! draw_footer(gs_p, pp);
- }
- }
-
- ! draw_header(gs, pp)
- Graphs gs;
- + int pp;
- {
- ! printf("%%!PS-Adobe-2.0 EPSF-1.2\n");
- printf("%%%%Pages: 0\n");
- printf("%%%%BoundingBox: %f %f %f %f\n", gs->bb[0], gs->bb[1], gs->bb[2], gs->bb[3]);
- printf("%%%%EndComments\n");
- ***************
- *** 301,307 ****
- printf("{$F2psEnteredState restore end} def\t%%%%EndProlog\n");
- printf("$F2psBegin\n");
- printf("%f 0 translate\n", gs->width / 2.0);
- ! if (gs->printable_postscript)
- printf("%f %f translate\n",
- ((8.5 * FCPI) - (gs->bb[2] - gs->bb[0])) / 2.0,
- (gs->bb[3] > (5.5*FCPI)) ? (11*FCPI) - gs->bb[3] : (5.5*FCPI));
- --- 364,370 ----
- printf("{$F2psEnteredState restore end} def\t%%%%EndProlog\n");
- printf("$F2psBegin\n");
- printf("%f 0 translate\n", gs->width / 2.0);
- ! if (pp)
- printf("%f %f translate\n",
- ((8.5 * FCPI) - (gs->bb[2] - gs->bb[0])) / 2.0,
- (gs->bb[3] > (5.5*FCPI)) ? (11*FCPI) - gs->bb[3] : (5.5*FCPI));
- ***************
- *** 309,317 ****
- printf("0.700 setlinewidth\n");
- }
-
- ! draw_footer(gs)
- Graphs gs;
- {
- printf("$F2psEnd\n");
- ! if (gs->printable_postscript) printf("showpage\n");
- }
- --- 372,381 ----
- printf("0.700 setlinewidth\n");
- }
-
- ! draw_footer(gs, pp)
- Graphs gs;
- + int pp;
- {
- printf("$F2psEnd\n");
- ! if (pp) printf("showpage\n");
- }
- *** ../work/edit.c Tue Oct 8 17:36:13 1991
- --- edit.c Tue Oct 8 16:55:14 1991
- ***************
- *** 1,7 ****
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/edit.c,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:45:11 $
- * $Author: jsp $
- */
-
- --- 1,7 ----
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/edit.c,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:44 $
- * $Author: jsp $
- */
-
- ***************
- *** 92,97 ****
- --- 92,99 ----
- a1->auto_hash_marks = a2->auto_hash_marks;
- a1->minor_hashes = a2->minor_hashes;
- a1->hash_scale = a2->hash_scale;
- + a1->gray = a2->gray;
- + a1->grid_lines = a2->grid_lines;
- a1->precision = a2->precision;
- a1->start_given = a2->start_given;
- a1->is_lg = a2->is_lg;
- ***************
- *** 111,116 ****
- --- 113,120 ----
- copy_axis(g->y_axis, prev(g)->y_axis);
- g->x_translate = prev(g)->x_translate;
- g->y_translate = prev(g)->y_translate;
- + g->clip = prev(g)->clip;
- + g->border = prev(g)->border;
- }
-
- edit_curve(c, g)
- ***************
- *** 120,125 ****
- --- 124,130 ----
- char inp_str[256];
- float x, y, f;
- Point p;
- + Flist fl;
- int i;
-
- while ( getstring(inp_str) ) {
- ***************
- *** 182,187 ****
- --- 187,199 ----
- fprintf(stderr, "\n");
- exit(1);
- } else c->marktype = MARKTYPES[i];
- + } else if (strcmp(inp_str, "glines") == 0) {
- + while (getfloat(&f)) {
- + fl = (Flist) get_node (c->gen_linetype);
- + fl->f = f;
- + insert(fl, c->gen_linetype);
- + }
- + rejecttoken();
- } else if (strcmp(inp_str, "linetype") == 0) {
- if (!getstring(inp_str)) return;
- if (strcmp(inp_str, "none") == 0) c->linetype = '0';
- ***************
- *** 188,201 ****
- else if (strcmp(inp_str, "solid") == 0) c->linetype = 's';
- else if (strcmp(inp_str, "dotted") == 0) c->linetype = '.';
- else if (strcmp(inp_str, "dashed") == 0) c->linetype = '-';
- else {
- error_header(); fprintf(stderr, "Bad line type: %s\n", inp_str);
- ! error_header(); fprintf(stderr, " Valid marks are %s.\n",
- ! "solid, dottted, dashed, none");
- exit(1);
- }
- } else if (strcmp(inp_str, "linethickness") == 0) {
- if (!getfloat(&f)) rejecttoken(); else c->linethick = f;
- } else {
- rejecttoken();
- return;
- --- 200,241 ----
- else if (strcmp(inp_str, "solid") == 0) c->linetype = 's';
- else if (strcmp(inp_str, "dotted") == 0) c->linetype = '.';
- else if (strcmp(inp_str, "dashed") == 0) c->linetype = '-';
- + else if (strcmp(inp_str, "longdash") == 0) c->linetype = 'l';
- + else if (strcmp(inp_str, "dotdash") == 0) c->linetype = 'd';
- + else if (strcmp(inp_str, "dotdotdash") == 0) c->linetype = 'D';
- + else if (strcmp(inp_str, "dotdotdashdash") == 0) c->linetype = '2';
- + else if (strcmp(inp_str, "general") == 0) c->linetype = 'g';
- else {
- error_header(); fprintf(stderr, "Bad line type: %s\n", inp_str);
- ! error_header(); fprintf(stderr, " Valid marks are %s\n",
- ! "solid, dotted, dashed, longdash, dotdash,");
- ! error_header(); fprintf(stderr, " %s.\n",
- ! "dotdotdash, dotdotdashdash, none");
- exit(1);
- }
- } else if (strcmp(inp_str, "linethickness") == 0) {
- if (!getfloat(&f)) rejecttoken(); else c->linethick = f;
- + } else if (strcmp(inp_str, "gray") == 0) {
- + if (!getfloat(&f)) rejecttoken(); else c->gray = f;
- + } else if (strcmp(inp_str, "larrows") == 0) {
- + c->larrows = 1;
- + } else if (strcmp(inp_str, "nolarrows") == 0) {
- + c->larrows = 0;
- + } else if (strcmp(inp_str, "rarrows") == 0) {
- + c->rarrows = 1;
- + } else if (strcmp(inp_str, "norarrows") == 0) {
- + c->rarrows = 0;
- + } else if (strcmp(inp_str, "asize") == 0) {
- + if (!getfloat(&f)) rejecttoken();
- + else {
- + c->asize[0] = f;
- + if (!getfloat(&f)) rejecttoken();
- + else c->asize[1] = f;
- + }
- + } else if (strcmp(inp_str, "clip") == 0) {
- + c->clip = 1;
- + } else if (strcmp(inp_str, "noclip") == 0) {
- + c->clip = 0;
- } else {
- rejecttoken();
- return;
- ***************
- *** 336,341 ****
- --- 376,387 ----
- a->draw_axis_label = 0;
- } else if (strcmp(inp_str, "draw_axis_label") == 0) {
- a->draw_axis_label = 1;
- + } else if (strcmp(inp_str, "no_grid_lines") == 0) {
- + a->grid_lines = 0;
- + } else if (strcmp(inp_str, "grid_lines") == 0) {
- + a->grid_lines = 1;
- + } else if (strcmp(inp_str, "gray") == 0) {
- + if ( getfloat(&f)) a->gray = f; else rejecttoken();
- } else {
- rejecttoken();
- return;
- ***************
- *** 427,432 ****
- --- 473,486 ----
- if (!getfloat(&f)) rejecttoken(); else gs->height = f;
- } else if (strcmp(inp_str, "X") == 0) {
- if (!getfloat(&f)) rejecttoken(); else gs->width = f;
- + } else if (strcmp(inp_str, "border") == 0) {
- + g->border = 1;
- + } else if (strcmp(inp_str, "noborder") == 0) {
- + g->border = 0;
- + } else if (strcmp(inp_str, "clip") == 0) {
- + g->clip = 1;
- + } else if (strcmp(inp_str, "noclip") == 0) {
- + g->clip = 0;
- } else {
- rejecttoken();
- return;
- ***************
- *** 437,446 ****
- edit_graphs(gs)
- Graphs gs;
- {
- char inp_str[80];
- float f;
- ! int num;
-
- while ( getstring(inp_str) ) {
- if (strcmp(inp_str, "graph") == 0) {
- if (!getint(&num)) {
- --- 491,502 ----
- edit_graphs(gs)
- Graphs gs;
- {
- + Graphs the_g;
- char inp_str[80];
- float f;
- ! int num, i;
-
- + the_g = first(gs);
- while ( getstring(inp_str) ) {
- if (strcmp(inp_str, "graph") == 0) {
- if (!getint(&num)) {
- ***************
- *** 447,461 ****
- error_header(); fprintf(stderr, "\"graph\" not followed by number\n");
- exit(1);
- }
- ! edit_graph(get_graph(gs->g, num), gs);
- } else if (strcmp(inp_str, "newgraph") == 0) {
- ! if (first(gs->g) == nil(gs->g))
- ! edit_graph(new_graph(gs->g, 0), gs);
- ! else edit_graph(new_graph(gs->g, last(gs->g)->num + 1), gs);
- } else if (strcmp(inp_str, "Y") == 0) {
- ! if (!getfloat(&f)) rejecttoken(); else gs->height = f;
- } else if (strcmp(inp_str, "X") == 0) {
- ! if (!getfloat(&f)) rejecttoken(); else gs->width = f;
- } else {
- error_header(); fprintf(stderr, "Bad token: %s\n", inp_str);
- exit(1);
- --- 503,530 ----
- error_header(); fprintf(stderr, "\"graph\" not followed by number\n");
- exit(1);
- }
- ! edit_graph(get_graph(the_g->g, num), the_g);
- } else if (strcmp(inp_str, "newgraph") == 0) {
- ! if (first(the_g->g) == nil(the_g->g))
- ! edit_graph(new_graph(the_g->g, 0), the_g);
- ! else edit_graph(new_graph(the_g->g, last(the_g->g)->num + 1), the_g);
- } else if (strcmp(inp_str, "Y") == 0) {
- ! if (!getfloat(&f)) rejecttoken(); else the_g->height = f;
- } else if (strcmp(inp_str, "X") == 0) {
- ! if (!getfloat(&f)) rejecttoken(); else the_g->width = f;
- ! } else if (strcmp(inp_str, "newpage") == 0) {
- ! new_graphs(gs);
- ! the_g = last(gs);
- ! } else if (strcmp(inp_str, "bbox") == 0) {
- ! for (i = 0; i < 4; i++) {
- ! if (!getfloat(&f)) {
- ! error_header();
- ! fprintf("Bbox definition must have four numbers\n");
- ! exit(1);
- ! } else {
- ! the_g->bb[i] = f;
- ! }
- ! }
- } else {
- error_header(); fprintf(stderr, "Bad token: %s\n", inp_str);
- exit(1);
- *** /dev/null Tue Oct 8 02:00:06 1991
- --- exit.c Tue Oct 8 16:55:14 1991
- ***************
- *** 0 ****
- --- 1,49 ----
- + /*
- + **++
- + ** FUNCTIONAL DESCRIPTION:
- + **
- + ** Exit is a VMS replacement for the standard Unix exit function
- + **
- + ** FORMAL PARAMETERS:
- + **
- + ** error_code integer passed by value (optional)
- + **
- + ** SIDE EFFECTS:
- + **
- + ** Exit will never return to calling program
- + ** VMS exit status ($STATUS) will be set
- + **--
- + **/
- + #include <varargs.h>
- +
- + exit(va_alist)
- + va_dcl
- + {
- + int nargs;
- + va_list va;
- + int exit_code = 0;
- + /*
- + * Pick up the argument, if present
- + */
- + va_count(nargs);
- + va_start(va);
- + if (nargs > 0) exit_code = va_arg(va,int);
- + /*
- + * Set the VMS $STATUS to the appropriate value:
- + * if exit_code == 0 then $STATUS := success
- + * if exit_code > 0 then $STATUS := error
- + * if exit_code < 0 then $STATUS := severe_error
- + * and perform exit.
- + *
- + * Note:
- + * the %X10000000 added to the actual success/error indicator
- + * will prevent DCL from printing a message.
- + * A 'on error' will be obeyed however.
- + */
- + if (exit_code == 0) /* success */
- + sys$exit(0x10000001);
- + else if (exit_code > 0) /* error */
- + sys$exit(0x10000002);
- + else /* severe error */
- + sys$exit(0x10000004);
- + }
- *** ../work/jgraph.1 Tue Oct 8 17:36:18 1991
- --- jgraph.1 Tue Oct 8 16:55:19 1991
- ***************
- *** 20,52 ****
- graphs with a minimum of effort, yet powerful enough to give the user
- the flexibility to tailor the appearance of the graph to his or her
- individual preferences. This includes plotting multiple graphs and
- ! laying them out separately on the page.
- .sp
- As an example, if the user wanted to simply plot the points (2,3),
- (4,5), (1,6), the following would be enough of a specification file:
- ! .EX
- ! newgraph
- ! newcurve pts 2 3 4 5 1 6
- ! .EE
- Now, if the user wanted to spruce the graph up by adding labels to
- the axes, connecting the points, and titling the graph, then the
- input could change to:
- ! .EX
- ! newgraph
- ! newcurve pts 2 3 4 5 1 6 linetype solid
- ! xaxis label : X axis
- ! yaxis label : Y axis
- ! title : This is an example graph
- ! .EE
- If the user instead wanted this to be a bar graph with different
- endpoints on the axes, he/she could simply change the input to:
- ! .EX
- ! newgraph
- ! xaxis min 0 max 5 label : X axis
- ! yaxis min 0 max 6 label : Y axis
- ! newcurve pts 2 3 4 5 1 6 marktype xbar
- ! title : This is an example bar graph
- ! .EE
- There are many more features of the description language, which are
- described below in the next section. Features which are not embedded
- within the description language are: line and function interpolation,
- --- 20,58 ----
- graphs with a minimum of effort, yet powerful enough to give the user
- the flexibility to tailor the appearance of the graph to his or her
- individual preferences. This includes plotting multiple graphs and
- ! laying them out separately on the page (or pages).
- .sp
- As an example, if the user wanted to simply plot the points (2,3),
- (4,5), (1,6), the following would be enough of a specification file:
- ! .PP
- ! .nf
- ! newgraph
- ! newcurve pts 2 3 4 5 1 6
- ! .fi
- ! .PP
- Now, if the user wanted to spruce the graph up by adding labels to
- the axes, connecting the points, and titling the graph, then the
- input could change to:
- ! .PP
- ! .nf
- ! newgraph
- ! newcurve pts 2 3 4 5 1 6 linetype solid
- ! xaxis label : X axis
- ! yaxis label : Y axis
- ! title : This is an example graph
- ! .fi
- ! .PP
- If the user instead wanted this to be a bar graph with different
- endpoints on the axes, he/she could simply change the input to:
- ! .PP
- ! .nf
- ! newgraph
- ! xaxis min 0 max 5 label : X axis
- ! yaxis min 0 max 6 label : Y axis
- ! newcurve pts 2 3 4 5 1 6 marktype xbar
- ! title : This is an example bar graph
- ! .fi
- ! .PP
- There are many more features of the description language, which are
- described below in the next section. Features which are not embedded
- within the description language are: line and function interpolation,
- ***************
- *** 110,129 ****
- character after the ``:'' starts the string, and the next newline
- character terminates it. Notice that in strings white-space is not
- ignored. Thus, the string ``Graph #1'' can be denoted as:
- ! .EX
- ! : Graph #1<newline>
- ! .EE
- or
- ! .EX
- ! :<newline>
- ! Graph #1<newline>
- ! .EE
- This way of denoting strings allows the user to embed leading and
- trailing spaces, as well as the null string. For example, the
- null string ``'' is represented by:
- ! .EX
- ! : <newline>
- ! .EE
- Once a string has been started, it may contain any character besides
- a newline. Specifically, it may contain the sequence ``(*'' or
- ``include'' without starting a comment or including a file.
- --- 116,139 ----
- character after the ``:'' starts the string, and the next newline
- character terminates it. Notice that in strings white-space is not
- ignored. Thus, the string ``Graph #1'' can be denoted as:
- ! .nf
- !
- ! : Graph #1<newline>
- !
- or
- !
- ! :<newline>
- ! Graph #1<newline>
- !
- ! .fi
- This way of denoting strings allows the user to embed leading and
- trailing spaces, as well as the null string. For example, the
- null string ``'' is represented by:
- ! .nf
- !
- ! : <newline>
- !
- ! .fi
- Once a string has been started, it may contain any character besides
- a newline. Specifically, it may contain the sequence ``(*'' or
- ``include'' without starting a comment or including a file.
- ***************
- *** 204,209 ****
- --- 214,249 ----
- and
- \fBX\fR
- respectively.
- + .TP
- + .B newpage
- + This command is for plotting graphs on multiple pages. After a
- + \fBnewpage,\fR
- + the graphs that the user enters will be plotted on a new page.
- + New graphs and strings will be numbered starting with 0.
- + Essentially,
- + \fBnewpage\fR
- + is the same as appending together the output of separate calls of
- + jgraph on the text before the
- + \fBnewpage,\fR
- + and on the text after the
- + \fBnewpage.\fR
- + \fBNewpage\fR
- + will most likely produce bizarre results if the
- + \fB\-P\fR
- + option is not specified.
- + .TP
- + \fBbbox \fIfloat\fB \fIfloat\fB \fIfloat\fB \fIfloat\fB\fR
- + Jgraph calculates a bounding box for the graph and
- + includes it in the header of the postscript output.
- + For the purposed of LaTeX, this is usually ok, as LaTeX doesn't
- + clip outside of the bounding box. Unfortunately, other programs
- + do clip, and sometimes jgraph doesn't calculate the bounding box
- + too well (text especially screws things up). This command lets
- + the user add his/her own bounding box. The units of this are
- + final postscript units. It's probably best to use the -p option
- + to see what the bounding box is that jgraph produces, and then
- + alter that accordingly with
- + \fBbbox\fR.
- .PD
- .RE
- .LP
- ***************
- *** 263,272 ****
- is to
- \fBnewcurve.\fR
- .TP
- \fBinherit_axes\fR
- This lets the user ``inherit'' the values of the last
- graph's axes. It copies all the attributes of the previous graph's x
- ! and y axes, as well as the x_translate and y_translate values.
- (Actually, this is a little bit of a lie, as it does not copy the
- values of the
- \fB\fIhash_at\fB, \fImhash_at\fB,\fR
- --- 303,336 ----
- is to
- \fBnewcurve.\fR
- .TP
- + \fBborder\fR
- + .br
- + .ns
- + .TP
- + \fBnoborder\fR
- + \fBBorder\fR
- + draws a square border around the area defined by the axes.
- + \fBNoborder\fR
- + specifies no border.
- + \fBNoborder\fR
- + is the default.
- + .TP
- + \fBclip\fR
- + .br
- + .ns
- + .TP
- + \fBnoclip\fR
- + \fBClip\fR
- + specifies that all curves in the graph will be clipped -- that is,
- + no points outside of the of axes will be plotted. Clipping can also be
- + specified on a per-curve basis. The default is
- + \fBnoclip\fR.
- + .TP
- \fBinherit_axes\fR
- This lets the user ``inherit'' the values of the last
- graph's axes. It copies all the attributes of the previous graph's x
- ! and y axes, as well as the x_translate and y_translate values, and the
- ! clipping.
- (Actually, this is a little bit of a lie, as it does not copy the
- values of the
- \fB\fIhash_at\fB, \fImhash_at\fB,\fR
- ***************
- *** 446,451 ****
- --- 510,525 ----
- \fBdraw_hash_marks,\fR
- and
- \fBdraw_hash_labels.\fR
- + .TP
- + \fBgrid_lines\fR
- + .br
- + .ns
- + .TP
- + \fBno_grid_lines\fR
- + \fBGrid_lines\fR
- + specifies to plot a grid line at each (major and minor) hash
- + mark on this axis. The default is
- + \fBno_grid_lines\fR.
- .PD
- .RE
- .LP
- ***************
- *** 490,509 ****
- option of
- \fBjgraph\fR
- .TP
- \fBfill \|[\fIfloat\fB\|]\fR
- This sets the filling of marks which define an area
- to fill (e.g. ``box'', ``circle'', ``xbar''). 1.0 fills the mark with
- white. 0.0 fills it with black. Anything in between is differing
- levels of gray. Anything negative fills it with nothing (i.e. makes
- ! it see-through). The default fill can be determined using the
- ! \fB\-p\fR
- ! option of
- ! \fBjgraph.\fR
- .TP
- \fBgmarks \|[\|{\fIfloat\fB\|} \|{\fIfloat\fB\|}\|]*\fR
- \fBGmarks\fR
- ! is a way for the user to
- ! define custom marks. For each mark on
- \fB(x,y),\fR
- Each pair of
- \fB\|{\fIfloat_x\fB\|}, \|{\fIfloat_y\fB\|}, \fR
- --- 564,584 ----
- option of
- \fBjgraph\fR
- .TP
- + \fBgray \|[\fIfloat\fB\|]\fR
- + This specifies the gray scale in which to draw the curve (i.e. the
- + curve's marks, lines, and arrows). 0.0 (The default) is black.
- + 1.0 is white.
- + .TP
- \fBfill \|[\fIfloat\fB\|]\fR
- This sets the filling of marks which define an area
- to fill (e.g. ``box'', ``circle'', ``xbar''). 1.0 fills the mark with
- white. 0.0 fills it with black. Anything in between is differing
- levels of gray. Anything negative fills it with nothing (i.e. makes
- ! it see-through). The default is 0 (black).
- .TP
- \fBgmarks \|[\|{\fIfloat\fB\|} \|{\fIfloat\fB\|}\|]*\fR
- \fBGmarks\fR
- ! is a way for the user to define custom marks. For each mark on
- \fB(x,y),\fR
- Each pair of
- \fB\|{\fIfloat_x\fB\|}, \|{\fIfloat_y\fB\|}, \fR
- ***************
- *** 512,529 ****
- Thus, for example, the
- ``box'' mark could be defined as ``\fIgmarks\fB -1 -1 -1 1 1 1 1 -1''.
- .TP
- \fBlinetype \|[\fItoken\fB\|]\fR
- ! This defines the type of the line connecting
- ! the points. Valid entries are ``solid'', ``dotted'', ``dashed'', and
- ! ``none''. The default is ``none''. Points are connected in the order in
- ! which they are inserted using the
- \fBpts\fR
- command.
- .TP
- \fBlinethickness \|[\fIfloat\fB\|]\fR
- This defines the line thickness (in
- absolute postscript units) of the connecting line. Default = 1.0.
- .TP
- \fBlabel\fR
- This edits the label of this curve for the purposed of
- drawing a legend. (see LABEL EDITING COMMANDS and LEGEND EDITING
- --- 587,664 ----
- Thus, for example, the
- ``box'' mark could be defined as ``\fIgmarks\fB -1 -1 -1 1 1 1 1 -1''.
- .TP
- + \fBlarrows\fR
- + .br
- + .ns
- + .TP
- + \fBrarrows\fR
- + .br
- + .ns
- + .TP
- + \fBnolarrows\fR
- + .br
- + .ns
- + .TP
- + \fBnorarrows\fR
- + \fBRarrows\fR
- + specifies to draw an arrow at the end of every line
- + segment in the curve.
- + \fBLarrows\fR
- + specifies to draw an arrow at the beginning of every line segment.
- + The size of the arrows can be changed by using
- + \fBasize\fR.
- + The
- + \fBfill\fR
- + token controls the filling of the head of the arrows.
- + The default is
- + \fBnolarrows\fR
- + and
- + \fBnorarrows\fR.
- + .TP
- + \fBasize \|[\fIfloat\fB\|] \|[\fIfloat\fB\|]\fR
- + This sets the size of the arrows. The first
- + \fB\|[\fIfloat\fB\|] \fR
- + controls the arrow's width. Its units are those of the x-axis.
- + The second
- + \fB\|[\fIfloat\fB\|] \fR
- + controls the arrow's height. It is in the units of the y-axis.
- + Use the -p option of jgraph to see the default values.
- + .TP
- \fBlinetype \|[\fItoken\fB\|]\fR
- ! This defines the type of the line connecting the points. Valid
- ! entries are ``solid'', ``dotted'', ``dashed'', ``longdash'',
- ! ``dotdash'', ``dotdotdash'', ``dotdotdashdash'', ``general'', and
- ! ``none''. The default is ``none''. ``General'' lets the user define
- ! his own linetype using the
- ! \fBglines\fR
- ! command described below. Points are connected in the
- ! order in which they are inserted using the
- \fBpts\fR
- command.
- .TP
- + \fBglines \|[\fIfloat\fB\|]*\fR
- + This lets the user specify the exact dashing of a line. The format
- + is as in postscript -- the first number is the length of the first
- + dash, the second is the length of the space after the first dash,
- + etc. For example, ``dotdash'' could be defined as ``\fIglines\fB 5 3
- + 1 3''.
- + .TP
- \fBlinethickness \|[\fIfloat\fB\|]\fR
- This defines the line thickness (in
- absolute postscript units) of the connecting line. Default = 1.0.
- .TP
- + \fBclip\fR
- + This specifies that this curve will be clipped -- that is,
- + no points outside of the of axes will be plotted.
- + .TP
- + \fBnoclip\fR
- + This turns off clipping. If clipping was specified for the
- + entire graph, then
- + \fBnoclip\fR
- + has no effect.
- + \fBNoclip\fR
- + is the default.
- + .TP
- \fBlabel\fR
- This edits the label of this curve for the purposed of
- drawing a legend. (see LABEL EDITING COMMANDS and LEGEND EDITING
- ***************
- *** 694,699 ****
- --- 829,839 ----
- marks, labels, axes, etc.
- .RS
- .TP
- + \fBgray \|[\fIfloat\fB\|]\fR
- + This specifies a gray-scale for drawing the axes (axis lines, hash
- + marks, hash labels and grid lines). The default is 0.0 (black).
- + 1.0 is white.
- + .TP
- \fBhash_at \|[\fIfloat\fB\|]\fR
- Draw a hash mark at this point. No label is
- made for this hash mark.
- ***************
- *** 928,934 ****
- .SH EMBEDDING THE OUTPUT IN LATEX
- I haven't read the manuals, but the way I've been loading these files
- into LaTeX has been as follows:
- ! .EX
- 1. Toward the beginning of my LaTeX file, I've had ``\\input{psfig}''
- 2. Where I've wanted my file, I've put:
-
- --- 1068,1075 ----
- .SH EMBEDDING THE OUTPUT IN LATEX
- I haven't read the manuals, but the way I've been loading these files
- into LaTeX has been as follows:
- ! .PP
- ! .nf
- 1. Toward the beginning of my LaTeX file, I've had ``\\input{psfig}''
- 2. Where I've wanted my file, I've put:
-
- ***************
- *** 943,949 ****
- 4. If that doesn't work, try dvips-ing the file and printing the postscript,
- and if that still doesn't work, try doing everything on a sun.
-
- ! .EE
- .SH BUGS
- If the
- \fBhash_scale \fR
- --- 1084,1091 ----
- 4. If that doesn't work, try dvips-ing the file and printing the postscript,
- and if that still doesn't work, try doing everything on a sun.
-
- ! .fi
- ! .PP
- .SH BUGS
- If the
- \fBhash_scale \fR
- ***************
- *** 953,957 ****
- --- 1095,1106 ----
- .sp
- Logarithmic axes cannot contain points <= 0. If I have
- enough complaints to convince me that this is a bug, I'll try to fix it.
- + .sp
- + If jgraph were really smart, then it would have arrow-heads go to the
- + edge of standard marks like circles, etc. Someday.
- + .sp
- + There is no real way to make the axes such that they decrease from
- + left to right or low to high -- or at least not without writing your
- + own hash labels.
- .sp
- There may well be loads of other bugs. Send to jsp@princeton.edu.
- *** ../work/jgraph.c Tue Oct 8 17:36:20 1991
- --- jgraph.c Tue Oct 8 16:55:15 1991
- ***************
- *** 1,7 ****
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/jgraph.c,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:45:13 $
- * $Author: jsp $
- */
-
- --- 1,7 ----
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/jgraph.c,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:48 $
- * $Author: jsp $
- */
-
- ***************
- *** 47,54 ****
- --- 47,57 ----
- new_c = (Curve) get_node(c);
- new_c->num = num;
- new_c->l = new_label();
- + new_c->clip = 0;
- + new_c->gray = 0.0;
-
- new_c->pts = (Point) make_list(sizeof(struct point));
- + new_c->gen_linetype = (Flist) make_list(sizeof(struct flist));
- new_c->marktype = MARKTYPES[num % NORMALMARKTYPES];
- new_c->linetype = '0';
- new_c->linethick = 1.0;
- ***************
- *** 56,64 ****
- new_c->marksize[1] = FSIG;
- new_c->general_marks = (Point) make_list(sizeof(struct point));
- i = num / NORMALMARKTYPES;
- ! if (i == 0) new_c->fill = 0.0;
- ! else if (i == 1) new_c->fill = 1.0;
- ! else new_c->fill = -1.0;
- prio_insert(new_c, c, 0);
- return new_c;
- }
- --- 59,69 ----
- new_c->marksize[1] = FSIG;
- new_c->general_marks = (Point) make_list(sizeof(struct point));
- i = num / NORMALMARKTYPES;
- ! new_c->fill = 0.0;
- ! new_c->rarrows = 0;
- ! new_c->larrows = 0;
- ! new_c->asize[0] = FSIG;
- ! new_c->asize[1] = FSIG;
- prio_insert(new_c, c, 0);
- return new_c;
- }
- ***************
- *** 113,118 ****
- --- 118,125 ----
- a->auto_hash_marks = 1;
- a->start_given = 0;
- a->hash_scale = -1.0;
- + a->grid_lines = 0;
- + a->gray = 0.0;
- a->is_x = is_x;
- a->is_lg = 0;
- a->hash_labels = (String) make_list (sizeof(struct string));
- ***************
- *** 206,211 ****
- --- 213,220 ----
- g->curves = (Curve) make_list(sizeof(struct curve));
- g->strings = (String) make_list(sizeof(struct string));
- g->title = new_title();
- + g->clip = 0;
- + g->border = 0;
- g->legend = new_legend();
- /* g->def = new_default(); */
- prio_insert(g, gs, 0);
- ***************
- *** 222,250 ****
- return new_g;
- }
-
- main(argc, argv)
- int argc;
- char **argv;
- {
- ! struct graphs gs;
- int i;
- ! char show;
-
- #ifdef VMS
- IOSTREAM = stdin; /* for token.c -hdd */
- #endif
- show = 0;
- ! gs.g = (Graph) make_list(sizeof(struct graph));
- ! gs.height = 0.0;
- ! gs.width = 0.0; /* added -hdd */
- ! gs.printable_postscript = 0;
- ! edit_graphs(&gs);
- ! process_graphs(&gs);
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-p") == 0) show = 1;
- ! else if (strcmp(argv[i], "-P") == 0) gs.printable_postscript = 1;
- }
- ! if (show) show_graphs(&gs); else draw_graphs(&gs);
- }
-
-
- --- 231,273 ----
- return new_g;
- }
-
- + new_graphs(gs)
- + Graphs gs;
- + {
- + Graphs newg;
- +
- + newg = (Graphs) get_node(gs);
- + newg->g = (Graph) make_list(sizeof(struct graph));
- + newg->height = 0.0;
- + newg->width = 0.0;
- + newg->bb[0] = FSIG; newg->bb[1] = FSIG;
- + newg->bb[2] = FSIG; newg->bb[3] = FSIG;
- + insert(newg, gs);
- + }
- +
- main(argc, argv)
- int argc;
- char **argv;
- {
- ! Graphs gs;
- int i;
- ! int show, pp;
-
- #ifdef VMS
- IOSTREAM = stdin; /* for token.c -hdd */
- #endif
- show = 0;
- ! pp = 0;
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-p") == 0) show = 1;
- ! else if (strcmp(argv[i], "-P") == 0) pp = 1;
- }
- ! gs = (Graphs) make_list(sizeof(struct graphs));
- ! new_graphs(gs, pp);
- ! edit_graphs(gs);
- ! process_graphs(gs);
- ! if (show) show_graphs(gs); else draw_graphs(gs, pp);
- ! exit(0);
- }
-
-
- *** /dev/null Tue Oct 8 02:00:06 1991
- --- jgraph.com Tue Oct 8 16:55:15 1991
- ***************
- *** 0 ****
- --- 1,39 ----
- + $! JGRAPH.COM: Execute jgraph on VMS.
- + $ SAVE_VER = 'F$VERIFY( F$TRNLNM( "JGRAPH_VERIFY"))'
- + $ ! How to use this procedure:
- + $ ! (1) define a symbol to execute the command file
- + $ ! $ JGRAPH :== @dev:[directory]JGRAPH.COM
- + $ ! We will assume that both this jgraph.com and jgraph.exe reside
- + $ ! in dev:[directory].
- + $ ! (2) Then, to run the program with say the HYPERCUBE.JGR file,
- + $ ! $ JGRAPH HYPERCUBE ! (Yes you can leave off the .JGR extension)
- + $ ! To generate a stand-alone PostScript file that can be sent directly
- + $ ! to the printer, use:
- + $ ! $ JGRAPH HYPERCUBE "-P"
- + $ ! or simply
- + $ ! $ JGRAPH HYPERCUBE -P
- + $ ! If you really want lowercase to reprint input in expanded form:
- + $ ! $ JGRAPH HYPERCUBE "-p"
- + $ ! The resulting output file will have a ".jps" extension.
- + $!
- + $ ON ERROR THEN GOTO EXIT
- + $ ON CONTROL_Y THEN GOTO EXIT
- + $!
- + $L1:
- + $ P1 = F$SEARCH( F$PARSE( P1, ".JGR"))
- + $ IF P1 .NES. "" THEN GOTO L2
- + $ INQUIRE /LOCAL P1 "Input File : "
- + $ GOTO L1
- + $L2:
- + $ JPS_FILE = F$PARSE( P1,,, "NAME") + ".JPS"
- + $ THIS_FILE = F$ENVIRONMENT("PROCEDURE")
- + $ HERE = F$PARSE(THIS_FILE,,,"DEVICE",) + F$PARSE(THIS_FILE,,,"DIRECTORY",)
- + $ RUN_JGRAPH := $'HERE'JGRAPH
- + $!
- + $ TMP = F$VERIFY( 1)
- + $ RUN_JGRAPH <'p1' >'jps_file' "''P2'"
- + $ $status = $STATUS
- + $ TMP = 'F$VERIFY( TMP)
- + $!
- + $EXIT:
- + $ EXIT $status + 0*F$VERIFY( SAVE_VER)
- *** ../work/jgraph.h Tue Oct 8 17:36:21 1991
- --- jgraph.h Tue Oct 8 16:55:15 1991
- ***************
- *** 1,7 ****
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/jgraph.h,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:46:24 $
- * $Author: jsp $
- */
-
- --- 1,7 ----
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/jgraph.h,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:50 $
- * $Author: jsp $
- */
-
- ***************
- *** 28,33 ****
- --- 28,39 ----
- float y;
- } *Point;
-
- + typedef struct flist {
- + struct flist *flink;
- + struct flist *blink;
- + float f;
- + } *Flist;
- +
- typedef struct label {
- char *label;
- float x;
- ***************
- *** 48,56 ****
- --- 54,68 ----
- Point general_marks;
- float marksize[2];
- float fill;
- + float gray;
- float linethick;
- + Flist gen_linetype;
- char marktype;
- char linetype;
- + int rarrows;
- + int larrows;
- + float asize[2];
- + int clip;
- } *Curve;
-
- typedef struct string {
- ***************
- *** 99,104 ****
- --- 111,118 ----
- float draw_hash_marks_at;
- float draw_hash_labels_at;
- float draw_at;
- + float gray;
- + int grid_lines;
- int draw_hash_labels;
- int draw_axis_line;
- int draw_hash_marks;
- ***************
- *** 121,127 ****
- float size;
- int anylines;
- float midspace;
- ! char type; /* 'n' = off, 't' = top, 'r' = right, 'u' = userdefined, 'c' = custom */
- } *Legend;
-
- typedef struct graph {
- --- 135,142 ----
- float size;
- int anylines;
- float midspace;
- ! char type; /* 'n' = off, 't' = top, 'r' = right,
- ! 'u' = userdefined, 'c' = custom */
- } *Legend;
-
- typedef struct graph {
- ***************
- *** 137,151 ****
- Legend legend;
- String strings;
- Label title;
- Default def;
- } *Graph;
-
- typedef struct graphs {
- Graph g;
- float height;
- float width;
- float bb[4]; /* Bounding box */
- - char printable_postscript;
- } *Graphs;
-
- extern float ctop();
- --- 152,169 ----
- Legend legend;
- String strings;
- Label title;
- + int clip;
- + int border;
- Default def;
- } *Graph;
-
- typedef struct graphs {
- + struct graphs *flink;
- + struct graphs *blink;
- Graph g;
- float height;
- float width;
- float bb[4]; /* Bounding box */
- } *Graphs;
-
- extern float ctop();
- *** ../work/list.c Tue Oct 8 17:36:22 1991
- --- list.c Tue Oct 8 16:55:16 1991
- ***************
- *** 1,7 ****
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/list.c,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:45:14 $
- * $Author: jsp $
- */
-
- --- 1,7 ----
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/list.c,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:51 $
- * $Author: jsp $
- */
-
- *** ../work/list.h Tue Oct 8 17:36:23 1991
- --- list.h Tue Oct 8 16:55:16 1991
- ***************
- *** 1,7 ****
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/list.h,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:46:26 $
- * $Author: jsp $
- */
-
- --- 1,7 ----
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/list.h,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:52 $
- * $Author: jsp $
- */
-
- *** ../work/printline.c Tue Oct 8 17:36:25 1991
- --- printline.c Tue Oct 8 16:55:16 1991
- ***************
- *** 1,7 ****
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/printline.c,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:45:15 $
- * $Author: jsp $
- */
-
- --- 1,7 ----
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/printline.c,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:54 $
- * $Author: jsp $
- */
-
- ***************
- *** 21,32 ****
- printf("newpath %f %f moveto %f %f lineto stroke\nstroke\n",
- y1, x1, y2, x2);}
-
- ! start_line(x1, y1, thickness, style)
- ! float x1, y1, thickness;
- ! char style;
- {
- ! setlinewidth(thickness);
- ! setlinestyle(style);
- printf("%f %f moveto ", x1, y1);
- }
-
- --- 21,32 ----
- printf("newpath %f %f moveto %f %f lineto stroke\nstroke\n",
- y1, x1, y2, x2);}
-
- ! start_line(x1, y1, c)
- ! float x1, y1;
- ! Curve c;
- {
- ! setlinewidth(c->linethick);
- ! setlinestyle(c->linetype, c->gen_linetype);
- printf("%f %f moveto ", x1, y1);
- }
-
- ***************
- *** 40,46 ****
- {
- printf("stroke\n stroke\n");
- setlinewidth(1.0);
- ! setlinestyle('s');
-
- }
-
- --- 40,46 ----
- {
- printf("stroke\n stroke\n");
- setlinewidth(1.0);
- ! setlinestyle('s', (Flist) 0);
-
- }
-
- ***************
- *** 129,142 ****
- printf("%f setlinewidth\n", size * LINEWIDTHFACTOR);
- }
-
- ! setlinestyle(style)
- char style;
- {
- switch(style) {
- case '0':
- case 's': printf("\t[] 0 setdash\n"); break;
- case '.': printf("\t [1 3.200000] 0 setdash\n"); break;
- case '-': printf("\t [4.00000] 0 setdash\n"); break;
- default: fprintf(stderr, "Error: Unknown line type: %c\n", style);
- exit(1);
- break;
- --- 129,155 ----
- printf("%f setlinewidth\n", size * LINEWIDTHFACTOR);
- }
-
- ! setlinestyle(style, glist)
- char style;
- + Flist glist;
- {
- + Flist fl;
- +
- switch(style) {
- case '0':
- case 's': printf("\t[] 0 setdash\n"); break;
- case '.': printf("\t [1 3.200000] 0 setdash\n"); break;
- case '-': printf("\t [4.00000] 0 setdash\n"); break;
- + case 'l': printf("\t [7 2] 0 setdash\n"); break;
- + case 'd': printf("\t [5 3 1 3] 0 setdash\n"); break;
- + case 'D': printf("\t [5 3 1 2 1 3] 0 setdash\n"); break;
- + case '2': printf("\t [5 3 5 3 1 2 1 3] 0 setdash\n"); break;
- + case 'g':
- + printf("\t [");
- + for (fl = first(glist); fl != nil(glist); fl = next(fl))
- + printf("%f ", fl->f);
- + printf("] 0 setdash\n");
- + break;
- default: fprintf(stderr, "Error: Unknown line type: %c\n", style);
- exit(1);
- break;
- *** ../work/prio_list.c Tue Oct 8 17:36:26 1991
- --- prio_list.c Tue Oct 8 16:55:16 1991
- ***************
- *** 1,7 ****
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/prio_list.c,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:45:17 $
- * $Author: jsp $
- */
-
- --- 1,7 ----
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/prio_list.c,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:55 $
- * $Author: jsp $
- */
-
- *** ../work/prio_list.h Tue Oct 8 17:36:27 1991
- --- prio_list.h Tue Oct 8 16:55:17 1991
- ***************
- *** 1,7 ****
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/prio_list.h,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:46:27 $
- * $Author: jsp $
- */
-
- --- 1,7 ----
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/prio_list.h,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:56 $
- * $Author: jsp $
- */
-
- *** ../work/process.c Tue Oct 8 17:36:28 1991
- --- process.c Tue Oct 8 16:55:17 1991
- ***************
- *** 1,7 ****
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/process.c,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:45:18 $
- * $Author: jsp $
- */
-
- --- 1,7 ----
- /*
- * $Source: /n/fs/vd/jsp/src/jgraph/RCS/process.c,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:56 $
- * $Author: jsp $
- */
-
- ***************
- *** 141,177 ****
- Axis a;
- {
- int i, b, b2, done;
- ! float x, x2;
-
- ! x2 = 0.0;
- b = 0;
- x = a->hash_interval;
-
- done = 0;
- while(b < 6 && !done) {
- ! i = (int) ((x - x2));
- x2 = i;
- ! if (x2 - x < .0000001 && x - x2 < .0000001) done = 1;
- else {
- b++;
- - x2 *= 10.0;
- x *= 10.0;
- }
- }
-
- ! x2 = 0.0;
- b2 = 0;
- x = a->hash_start;
-
- done = 0;
- while(b2 < 6 && !done) {
- ! i = (int) (x - x2);
- x2 = i;
- ! if (x2 - x < .0000001 && x - x2 < .0000001) done = 1;
- else {
- b2++;
- - x2 *= 10.0;
- x *= 10.0;
- }
- }
- return MAX(b, b2);
- --- 141,177 ----
- Axis a;
- {
- int i, b, b2, done;
- ! float x, x2, tolerance;
-
- ! tolerance = 0.000001;
- b = 0;
- x = a->hash_interval;
-
- done = 0;
- while(b < 6 && !done) {
- ! i = (int) (x + 0.4);
- x2 = i;
- ! if (x2 - x < tolerance && x - x2 < tolerance) done = 1;
- else {
- b++;
- x *= 10.0;
- + tolerance *= 10.0;
- }
- }
-
- ! tolerance = 0.000001;
- b2 = 0;
- x = a->hash_start;
-
- done = 0;
- while(b2 < 6 && !done) {
- ! i = (int) (x + 0.4);
- x2 = i;
- ! if (x2 - x < tolerance && x - x2 < tolerance) done = 1;
- else {
- b2++;
- x *= 10.0;
- + tolerance *= 10.0;
- }
- }
- return MAX(b, b2);
- ***************
- *** 323,330 ****
- if (ABS(t1) >= 1.0 || t1 == 0.0) prec = 0;
- else {
- tmp = ABS(t1);
- ! prec = 2;
- ! while(tmp < 0.0) {tmp *= 10.0; prec++;}
- }
- }
- sprintf(s->s->label, "%.*f", prec, t1);
- --- 323,330 ----
- if (ABS(t1) >= 1.0 || t1 == 0.0) prec = 0;
- else {
- tmp = ABS(t1);
- ! prec = -1;
- ! while(tmp < 1.0) {tmp *= 10.0; prec++;}
- }
- }
- sprintf(s->s->label, "%.*f", prec, t1);
- ***************
- *** 441,446 ****
- --- 441,450 ----
- 4.0 : disttop(c->marksize[0], g->x_axis);
- c->marksize[1] = (c->marksize[1] == FSIG) ?
- 4.0 : disttop(c->marksize[1], g->y_axis);
- + c->asize[0] = (c->asize[0] == FSIG) ?
- + 6.0 : disttop(c->asize[0], g->x_axis);
- + c->asize[1] = (c->asize[1] == FSIG) ?
- + 2.0 : disttop(c->asize[1], g->y_axis);
- }
-
- process_curves(g)
- ***************
- *** 470,495 ****
- process_graphs(gs)
- Graphs gs;
- {
- Graph g;
- float tmp_x, x, max_y, min_y;
-
- ! for (g = first(gs->g); g != nil(gs->g); g = next(g)) process_graph(g);
-