# source:trunk/Jgraph/jgraph.1@418

Last change on this file since 418 was 418, checked in by Nicholas Riley, 12 years ago

Jgraph 8.3 from http://www.cs.utk.edu/~plank/plank/jgraph/jgraph.tar.gz

File size: 46.5 KB
Line
1.\" SCCSID: @(#)jgraph.1        1.1     10/23/89
2.\" SCCSID: @(#)jgraph.1        1.1     10/23/89
3.TH jgraph 1
4.SH NAME
5jgraph \- filter for graph plotting to postscript
6.SH SYNTAX
7.B jgraph
8[\-\fIp\fR\|]
9[\-\fIP\fR\|]
10[\-\fIL\fR\|]
12[\fIfilename\fR ...\|]
13.SH DESCRIPTION
14\fBJgraph\fR
15takes the description of a graph or graphs
16and produces a postscript file on the standard output.
17\fBJgraph\fR
18is ideal for plotting any mixture of scatter point graphs, line
19graphs, and/or bar graphs, and embedding the output into LaTeX, or
20any other text processing system which can read postscript.
21.sp
22\fBJgraph\fR reads its input from the specified files.  If no
23files are specified, then it reads from standard input.
24.sp
25The graph description language is simple enough to get nice looking
26graphs with a minimum of effort, yet powerful enough to give the user
27the flexibility to tailor the appearance of the graph to his or her
28individual preferences.  This includes plotting multiple graphs and
29laying them out separately on the page (or pages).
30.sp
31As an example, if the user wanted to simply plot the points (2,3),
32(4,5), (1,6), the following would be enough of a specification file:
33.PP
34.nf
35        newgraph
36        newcurve pts 2 3 4 5 1 6
37.fi
38.PP
39Now, if the user wanted to spruce the graph up by adding labels to
40the axes, connecting the points, and titling the graph, then the
41input could change to:
42.PP
43.nf
44        newgraph
45        newcurve pts 2 3 4 5 1 6 linetype solid
46        xaxis label : X axis
47        yaxis label : Y axis
48        title : This is an example graph
49.fi
50.PP
51If the user instead wanted this to be a bar graph with different
52endpoints on the axes, he/she could simply change the input to:
53.PP
54.nf
55        newgraph
56        xaxis min 0 max 5 label : X axis
57        yaxis min 0 max 6 label : Y axis
58        newcurve pts 2 3 4 5 1 6 marktype xbar
59        title : This is an example bar graph
60.fi
61.PP
62There are many more features of the description language, which are
63described below in the next section.  Features which are not embedded
64within the description language are: line and function interpolation,
65function plotting, and pie graphs.  The latter is impossible to do
66with the aid of
67\fBjgraph, \fR
68however, the others can be effected with
69\fBjgraph \fR
70mixed with awk or c.  See
71FUNCTION PLOTTING AND OTHER NON-INHERENT FEATURES
72below.
73.sp
74Also below is a section
75HINTS AND EXAMPLE GRAPHS, which may give good
76ideas on how to use
77\fBjgraph \fR
78more effectively.
79.SH OPTIONS
80.TP
81.B \-P
82The
83\fB\-P\fR
84option produces postscript which can be piped directly to
85\fBlpr,\fR
86which can be displayed in an Xwindows environment with
87\fBgs\fR
88(ghostscript).
89Without this option, the output should be embedded within
90\fBLaTeX\fR
91or a similar text processing system.
92.TP
93.B \-L
94The
95\fB\-L\fR
96option produces a landscape plot.
97.TP
98.B \-p
99The
100\fB\-p\fR
101option re-prints the input on the standard output, only
102with all the defaults made explicit.  This is useful for letting the
103user do his/her own special formatting, as it shows the explicit
104values that the defaults assume, so that they can be manipulated.
105.TP
107This option makes jgraph put comments into the output postscript.  These
108make it easier for the user to wade through the final postscript if
109necessary.
110.SH THE DESCRIPTION LANGUAGE
111The description language is essentially keywords followed by
112attributes.  All keywords and attributes except for string attributes
113are tokens -- non-white-space characters surrounded by white-space.
114Special tokens are
115(*'', *)'', include'', :'', and shell'', which denote
116comments, include-file statements, string identifiers, and shell-include
117statements:
118.TP
120Comments are surrounded by the tokens (*'' *)'' as in
121Modula-2 (except that here, the tokens must be surrounded by white-
122space).  Comments may be nested.  If the comment runs to the end of a
123file, the last *)'' may be omitted.
124.TP
125.B Include\-file statements
126The token following an include'' token is
127expected to be a file name.  The result of the statement is to
128include the contents of the file at that point.  Include-file
129statments can be nested within included files, and within shell
130includes.
131.TP
132.B Strings
133In places where strings are required (as in graph and
134curve labels), they are denoted by the token :''.  The second
135character after the :'' starts the string, and the next newline
136character terminates it.
137Thus, the string Graph #1'' can be denoted as:
138.nf
139
140        : Graph #1<newline>
141
142or
143
144        :<newline>
145        Graph #1<newline>
146
147.fi
148One can get multiline strings by making
149a backslash the last character before the newline on all but the
150last line.  Notice that in strings white-space is not ignored.
151This way of denoting strings allows the user to embed leading and
152trailing spaces, as well as the null string.  For example, the
153null string '' is represented by:
154.nf
155
156        : <newline>
157
158.fi
159Once a string has been started, it may contain any character.
160Specifically, it may contain the sequence (*'', shell'',
161or include'' without starting a comment or including a file.
162Each line of a string must contain less than 1000 characters.  Otherwise
163string sizes are limited only by the size of memory.
164.TP
165.B Shell\-include statements
166Shell include statements are of the form shell'', :'', and then
167a string.  The result of the statement is that the string is executed
168(using popen, which passes the string to sh), and the standard
169output is included at that point.  Shell-includes can be freely
170nested within include-files and other shell-includes.  Shell
171commands may be more than one line, but must not exceed 1000 characters.
172The shell statement is not (yet) available on VMS.
173.TP
174.B Notation
175In the descriptions below:
176.RS
177.TP
178\fBtk \|{\fIinteger\fB\|}\fR
179means that token
180\fBtk \fR
181must be followed by an integer.
182.TP
183\fBtk \|[\fIinteger\fB\|]\fR
184means that
185\fBtk\fR
186may be followed by an integer, but doesn't have to.  In most cases, if
187\fBtk\fR
188is not followed by an integer, then the command denoted by
189\fBtk \fR
190is ignored.
191.TP
192\fBtk \|[\|{\fIinteger\fB\|} \|{\fIinteger\fB\|}\|]*
193means that
194\fBtk\fR
195must be
196followed by an even number of integers.
197.PD
198.LP
199Supported types other than
200integer are:
201\fB\|{\fIfloat\fB\|} \fR
202for floating point entries,
203\fB\|{\fItoken\fB\|} \fR
204for any
205token, and
206\fB\|{\fIstring\fB\|} \fR
207for a string as defined above.
208.RE
209.TP
210.B TOP-LEVEL DESCRIPTION COMMANDS
211.RS
212.TP
213.B newgraph
214This starts editing a new graph (see GRAPH EDITING
215COMMANDS).  Note that multiple graphs may be drawn on the same page.
216.TP
217\fBgraph \|{\fIinteger\fB\|}\fR
218This edits the graph denoted by
219\fB\|{\fIinteger\fB\|}.  \fR
220If the graph doesn't exist, then this command creates it and starts
221editing it.
222\fBNewgraph\fR
223is simply an abbreviation for
224\fB\fIgraph\fB \fIn\fB\fR
225where n=0 if this is the first graph, otherwise n=m+1, where m is the
226largest number of any graph so far.
227.TP
228\fBcopygraph \|[\fIinteger\fB\|]\fR
229This creates a new graph, and copies all the attributes from the
230graph
231\fB\|[\fIinteger\fB\|]'s\fR
232x and y axes, as well as its
233\fB\fIx_translate\fB\fR
234and
235\fB\fIy_translate\fB\fR
236values, the clipping, the legend defaults, and
237the title defaults.   If the
238\fB\|[\fIinteger\fB\|]\fR
239is omitted, then it copies its values from the previous''
240graph, which is
241defined to be the graph with the largest number
242less than the currrent graph's number.  If the current
243graph has the smallest number, then it will take the last graph from
244the previous page of graphs.  If there is no previous page, then an
245error will be flagged.
246(copygraph does not copy the values of the
247\fB\fIhash_at\fB, \fImhash_at\fB,\fR
248and
249\fB\fI\fIhash_label\fB\fR
250attributes).
251.TP
252.B newpage
253This command is for plotting graphs on multiple pages.  After a
254\fBnewpage,\fR
255the graphs that the user enters will be plotted on a new page.
256New graphs and strings will be numbered starting with 0.
257Essentially,
258\fB\fInewpage\fB\fR
259is the same as appending together the output of separate calls of
260jgraph on the text before the
261\fB\fInewpage,\fB\fR
262and on the text after the
263\fB\fInewpage.\fB\fR
264\fB\fINewpage\fB\fR
265will most likely produce bizarre results if the
266\fB\-P\fR
267option is not specified.
268.TP
269\fBX \|[\fIfloat\fB\|]\fR
270.br
271.ns
272.TP
273\fBY \|[\fIfloat\fB\|]\fR
274Postscript files to be embedded in LaTeX (and some other programs)
275contain a bounding box''
276which defines the area which LaTeX will allocate for the postscript.
277Other programs use this bounding box as well, sometimes using it
278to define where to clip the postscript image.
279\fBJgraph \fR
280uses the axis lines and labels, and the title to generate its
281bounding box.  Most of the time that's good enough to work in
282LaTeX.  The
283\fB\fIY\fB\fR
284and
285\fB\fIX\fB\fR
286commands say to make the height and width of the bounding box at least
287\fB\fIY\fB\fR
288and
289\fB\fIX\fB\fR
290inches, respectively, but to maintain the current centering of the
291graph.  If you still need further control over the
292bounding box (e.g. to change the centering), try the
293\fB\fIbbox\fB\fR
294command.  If there's more than one page in the jgraph file,
295\fB\fIY,\fB\fR
296\fB\fIX\fB\fR
297and
298\fB\fIbbox\fB\fR
299values can be given for each graph.
300.TP
301\fBbbox \fIfloat\fB \fIfloat\fB \fIfloat\fB \fIfloat\fB\fR
302If the
303\fB\fIY\fB\fR
304and
305\fB\fIX\fB\fR
306commands aren't enough to help you define a good bounding box, this
307command lets you explicitly enter one which will go directly into the
308jgraph output.  Its units are the
309final postscript units.  It's probably best to use the
310\fB\-p\FR
311option
312to see what the bounding box is that jgraph produces, and then
313alter that accordingly with
314\fB\fIbbox.\fB\fR
315The main use for this is to change the automatic centering that jgraph
316performs:  Usually the center of the bounding box that jgraph computes
317is put at the center of the page.  Changing the bbox changes this
318center.
319.TP
320\fBpreamble : \|{\fIstring\fB\|}\fR
321.br
322.ns
323.TP
324\fBpreamble {\fItoken\fB\|}\fR
325.br
326.ns
327.TP
328\fBepilogue : \|{\fIstring\fB\|}\fR
329.br
330.ns
331.TP
332\fBepilogue {\fItoken\fB\|}\fR
333These two commands allow the user to include strings or
334files (the token specifies the filename) which will be copied directly
335into jgraph's output.
336The \fIpreamble\fB is included at the beginning of the output
337(after some initial postscript to set things up for jgraph),
338and the \fIepilogue\fB is included at the end.  A good use for
339the \fIpreamble\fB is to set up a postscript dictionary if you're
340using postscript marks.
341.PD
342.RE
343.LP
344.TP
345.B GRAPH EDITING COMMANDS
346These commands act on the current graph.
347Graph editing is terminated when one of the top-level description
348commands is given.
349.RS
350.TP
351\fBxaxis\fR
352.br
353.ns
354.TP
355\fByaxis\fR
356Edit the x or y axis (see AXIS EDITING COMMANDS)
357.TP
358\fBnewcurve\fR
359This starts editing a new curve of the graph (see CURVE
360EDITING COMMANDS).
361.TP
362\fBcurve \|{\fIinteger\fB\|}\fR
363This edits the curve denoted by
364\fB\|{\fIinteger\fB\|}.  \fR
365If the curve doesn't exist, then this command creates it and starts
366editing it.
367\fINewcurve\fB
368and
369\fIcurve\fB
370interact as
371\fInewgraph\fB
372and
373\fIgraph\fB
374do.
375.TP
376\fBnewline\fR
377This is an abbreviation for:
378.PP
379.nf
380          newcurve marktype none linetype solid
381.fi
382.PP
383.TP
384\fBcopycurve \|[\fIinteger\fB\|]\fR
385This starts editing a new curve of the graph, and copies all its
386values except for the points from curve
387\fB\|[\fIinteger.\fB\|]\fR
388If the
389\fB\|[\fIinteger\fB\|]\fR
390is omitted, then it copies its values from the
391last curve in this graph.  If this graph currently has
392no curves, then it searches backwards from the previous graph.
393.TP
394\fBtitle\fR
395This edits the title of the graph (see LABEL EDITING
396COMMANDS).  The title is given a default location centered beneath
397the graph, and a default font size of 12, however, as with all
398labels, this can be changed.
399.TP
400\fBlegend\fR
401The edits the legend of the graph (see LEGEND EDITING
402COMMANDS).  As a default, the graph will contain a legend
403if any of its curves have labels.
404.TP
405\fBnewstring\fR
406This edits a new text string (see LABEL EDITING
407COMMANDS).  This is useful as it allows the user to plot text on the
408graph as well as curves.
409.TP
410\fBstring \|{\fIinteger\fB\|}\fR
411.br
412.ns
413.TP
414\fBcopystring \|[\fIinteger\fB\|]\fR
415\fIString\fB
416and
417\fIcopystring\fB
418are to
419\fInewstring\fB
420as
421\fIcurve\fB
422and
423\fIcopycurve\fB
424are to
425\fInewcurve.\fB
426.TP
427\fBborder\fR
428.br
429.ns
430.TP
431\fBnoborder\fR
432\fIBorder\fR\fB
433draws a square border around the area defined by the axes.
434\fINoborder\fB
435specifies no border.
436\fINoborder\fB
437is the default.
438.TP
439\fBclip\fR
440.br
441.ns
442.TP
443\fBnoclip\fR
444\fIClip\fB
445specifies that all curves in the graph will be clipped -- that is,
446no points outside of the of axes will be plotted.  Clipping can also be
447specified on a per-curve basis.  The default is
448\fInoclip.\fB
449.TP
450\fBinherit_axes\fR
451This is an old command which is kept for backward compatibility.
452\fICopycurve.\fB
453is equivalent to:
454.PP
455.nf
456          newgraph inherit_axes
457.fi
458.PP
459.TP
460\fBx_translate \|[\fIfloat\fB\|]\fR
461.br
462.ns
463.TP
464\fBy_translate \|[\fIfloat\fB\|]\fR
465By default, the bottom left-hand corner of each graph is at point
466(0,0) (final postscript units).
467\fIX_translate\fB
468and
469\fIY_translate\fB
470translate the bottom left-hand corner of the graph
471\fB\|[\fIfloat\fB\|] \fR
472inches.  The main use of this is to draw more than one graph on
473a page.  Note that jgraph considers all the graphs drawn on the
474page when it computes its bounding box for centering.  Thus, if
475only one graph is drawn, it will always be centered on the page,
476regardless of its
477\fIX_translate\fB
478and
479\fIY_translate\fB
480values.  These values are used for relative placement of the graphs.
481   To change the centering of the graphs, use
482\fIbbox.\fB
483.TP
484\fBX \|[\fIfloat\fB\|]\fR
485.br
486.ns
487.TP
488\fBY \|[\fIfloat\fB\|]\fR
489These are the same as
490\fIX\fB
491and
492\fIY\fB
493in the
494Top-level commands, except that they let the user continue editing
495the current graph.
496.PD
497.RE
498.LP
499.TP
500.B SIMPLE AXIS EDITING COMMANDS
501These commands act on the current
502axis as chosen by
503\fIxaxis\fB
504or
505\fIyaxis\fB
506(see GRAPH EDITING COMMANDS).
507Axis editing terminates when a graph or top-level command is given.
508There are more advanced axis editing commands given below which have
509to do with moving the hash marks, adding new hash marks and labels,
510etc.  See ADVANCED AXIS EDITING COMMANDS.
511.RS
512.TP
513\fBlinear\fR
514.br
515.ns
516.TP
517.B log
518Set the axis to be linear or logarithmic. The
519default is linear.  If the axis is set to be logarithmic, then values
520<= 0.0 will be disallowed, as they are at negative infinity on the
521axis.
522.TP
523\fBmin \|[\fIfloat\fB\|]\fR
524.br
525.ns
526.TP
527\fBmax \|[\fIfloat\fB\|]\fR
528Set the minimum and maximum values of
529this axis.  Defaults depend on the points given.  They can be seen by
530using the
531\fB\-p \fR
532option.  Unless stated, all units (for example point
533plotting, string plotting, etc.) will be in terms of the
534\fImin\fB
535and
536\fImax\fB
537values of the x and y axes.
538.TP
539\fBsize \|[\fIfloat\fB\|]\fR
540Set the size of this axis in inches.
541.TP
542\fBlog_base \|[\fIfloat\fB\|]\fR
543Set the base of the logarithmic axis. Default =
54410.  This is the value which determines which hash
545marks and hash labels are automatically produced.
546.TP
547\fBhash \|[\fIfloat\fB\|]\fR
548Hash marks will be
549\fB\|[\fIfloat\fB\|] \fR
550units apart.  Default = -1.
551If this value equals 0, then there will be no hash marks.  If
552this value is less than 0, then the hash marks will be automatically
553set by
554\fBjgraph \fR
555(see
556\fB\-p \fR
557for the value).  By default, each hash mark
558will be labeled with its value.
559\fIHash\fB
560and
561\fIshash\fB
562are ignored if
563the axes are logarithmic.
564.TP
565\fBshash \|[\fIfloat\fB\|]\fR
566Make sure there is a hash mark at the point
567\fB\|[\fIfloat\fB\|] \fR
568along the axis.  The default is set by
569\fBjgraph\fR
570if
571\fBhash\fR
572= -1.
573If
574\fIhash\fB
575is set by the user,
576\fIshash\fB
577is defaulted to the
578\fImin\fB
579value of the axis.
580.TP
581\fBmhash \|[\fIinteger\fB\|]\fR
582Put
583\fB\|[\fIinteger\fB\|] \fR
584minor hash marks between the above
585hash marks.  Default = -1.  If this value equals 0, then there will
586be no minor hash marks.  If this value is negative, then the value
587will be chosen by
588\fBjgraph \fR
589(see
590\fB\-p\fR
591for the value).
592.TP
593\fBprecision \|[\fIinteger\fB\|]\fR
594.TP
595\fBhash_format \fItoken\fB\fR
596These control how jgraph formats the automatic hash labels.
597The user shouldn't have to worry about these values, except in
598extreme cases.  Jgraph uses \fBprintf\fR to format the labels.
599If \fBhash_format\fR is f'' (the default), then the
600value of a hash label is printed with
601.PP
602.nf
603        printf("%.*f", precision, value).
604.fi
605.PP
606Other valid \fBhash_format\fR values are G'', g'', E'', and e''.
607G'' is a good generic format which converts to scientific notation
608if the value becomes too big or too small.
609If the precision is negative, then jgraph chooses a default:  For
610g'' and G'', the default is 6.  For e'' and E'', the default
611is 0, and for f'', jgraph tries to determine a reasonable default.
613of how it formats floating point numbers.
614.TP
615\fBlabel\fR
616Edit the label of this axis (see LABEL EDITING COMMANDS).
617By default, the label is in font Times-Bold'', and has a font size of
61810.  If the user doesn't change any of the plotting attributes of the
619label,
620\fBjgraph \fR
621chooses an appropriate place for the axis label.
622.TP
623\fBdraw_at \|[\fIfloat\fB\|]\fR
624Draw the axis line at this point on the other axis.
625The default is usually the other axis's
626\fImin, \fB
627however if
628\fIhash_scale \fB
629is positive (see
630\fIhash_scale \fB
631under ADVANCED AXIS EDITING), it will be
632the other axis's
633\fImax.\fB
634.TP
635\fBnodraw\fR
636Do not draw the axis, the hash marks or any labels.  This
637is useful for plotting points with no axes, and for overlaying graphs
638on top of one another with no clashes.  This is equivalent to
639\fIno_draw_axis,\fB
640\fIno_draw_axis_label,\fB
641\fIno_draw_hash_marks,\fB
642and
643\fIno_draw_hash_labels.\fB
644.TP
645\fBdraw\fR
646Cancels the effect of
647\fInodraw.  \fB
648Default =
649\fIdraw.\fB
650This is
651equivalent to
652\fIdraw_axis,\fB
653\fIdraw_axis_label,\fB
654\fIdraw_hash_marks,\fB
655and
656\fIdraw_hash_labels.\fB
657.TP
658\fBgrid_lines\fR
659.br
660.ns
661.TP
662\fBno_grid_lines\fR
663\fIGrid_lines\fB
664specifies to plot a grid line at each major hash
665mark on this axis.  The default is
666\fIno_grid_lines.\fB
667.TP
668\fBmgrid_lines\fR
669.br
670.ns
671.TP
672\fBno_mgrid_lines\fR
673\fIMgrid_lines\fB
674specifies to plot a grid line at each minor hash
675mark on this axis.  The default is
676\fIno_mgrid_lines.\fB
677.PD
678.RE
679.LP
680.TP
681.B CURVE EDITING COMMANDS
682These commands act on the current curve as
683chosen by
684\fInewcurve\fB
685or
686\fIcurve\fB
687(see GRAPH EDITING COMMANDS).  Curve
688editing terminates when a graph or top-level command is given.
689.RS
690.TP
691\fBpts \|[\|{\fIfloat\fB\|} \|{\fIfloat\fB\|}\|]*\fR
692This sets the points to plot in this
693curve.  The first
694\fIfloat\fB
695is the x value, and the second
696\fIfloat\fB
697is the y
698value of the point.  Points are plotted in the order specified.
699This command stops reading points when a non-float is given.
700The user can specify this command multiple times within a curve --
701each time, simply more points are added to the curve.
702.TP
703\fBx_epts \|[\|{\fIfloat\fB\|} \|{\fIfloat\fB\|} \|{\fIfloat\fB\|} \|{\fIfloat\fB\|}\|]*\fR
704.br
705.ns
706.TP
707\fBy_epts \|[\|{\fIfloat\fB\|} \|{\fIfloat\fB\|} \|{\fIfloat\fB\|} \|{\fIfloat\fB\|}\|]*\fR
708This allows the user to specify points and confidence values'' (otherwise
709known as error bars'').  The first two
710\fIfloats\fB
711specify the x and y values of
712the point, as above.  If
713\fBx_epts\fR
714is specified,  then the second two
715\fIfloats\fB
716specify range or confidence values
717for the x value of the point.
718Error bars will be printed to each of these x values (using the
719original point's y value)
720from the original point.  Similarly,
721\fIy_epts\fB
722specifies range or confidence values for the y value of the point.
723\fIpts\fB
724\fIx_epts\fB
725and
726\fIy_epts\fB
727can all be intermixed.
728.TP
729\fBmarktype\fR
730This sets the kind of mark that is plotted for this curve.  Valid
731marks are: \fIcircle\fR, \fIbox\fR, \fIdiamond\fR, \fItriangle\fR,
732\fIx\fR, \fIcross\fR, \fIellipse\fR, \fIxbar\fR, \fIybar\fR,
733\fItext\fR, \fIpostscript\fR, \fIeps\fR, \fInone\fR, and variants of
734\fIgeneral\fR.  Most of these are self-explanatory, except for the
735last few:
736  \fIXbar\fR makes the curve into a bar graph with the bars going
737to the x axis.  \fIYbar\fR has the bars going to the y axis.
738  \fIText\fR lets the user plot text instead of a mark.  The text is
739editted as a label (see LABEL EDITING COMMANDS) immediately following
740the \fItext\fR command.  The x and y fields of the label have special
741meanings here:  They define where the label is to be printed in relation
742to the curve points.  For example, if they are both 0, the label will
743be printed directly on the curve points.  If x is 1.0 and y is -1.0, then
744the label will be printed one unit to the right and one unit below the
745curve points (units are units of the x and y axes).
746Default label values are 0 for x and y, and center justification.
747  \fIPostscript:\fR See the \fIpostscript\fB token below.
748  \fIEps:\fR See the \fIeps\fB token below.
749  \fINone\fR means that no mark will be
750plotted (this is useful for drawing lines).
751  There are four types of \fIgeneral\fR marks, which work using the
752\fIgmarks\fB command described below.  The four marktypes are
753\fIgeneral\fR, \fIgeneral_nf\fR, \fIgeneral_bez\fR, and
754\fIgeneral_bez_nf\fR.
755  By default, a new mark is chosen for each curve.
756.TP
757\fBmarksize \|[\fIfloat\fB\|] \|[\fIfloat\fB\|]\fR
758This sets the size of the mark.  The
759first
760\fB\|[\fIfloat\fB\|] \fR
761is the width of the mark, and the second is the height.
762Units are those of the x and y axes respectively, unless that axis is
763logarithmic, in which case the units are inches.  Negative marksizes
764are allowed (e.g.  a negative height will flip a \fItriangle\fR mark).
765The default mark size can be determined using the
766\fB\-p\fR
767option of
768\fBjgraph\fR
769.TP
770\fBmrotate \|[\fIfloat\fB\|]\fR
771This allows the user to rotate the mark
772\fB\|[\fIfloat\fB\|] \fR
773degrees.  Default is zero.
774.TP
775\fBgray \|[\fIfloat\fB\|]\fR
776.br
777.ns
778.TP
779\fBcolor \|[\fIfloat\fB \fIfloat\fB \fIfloat\fB\|]\fR
780These specify either the grayness of the curve or its color.  Values
781for
782\fIgray\fR
783should be from 0 (black) to 1 (white).  Values for
784\fIcolor\fR\fB
785should also be from 0 to 1.  They are RGB values, and thus define the
786amount of red, green and blue in the curve respectively.  Specifying
787color nullifies the gray value, and vice versa.  The default is
788\fIgray 0\fB
789.TP
790\fBfill \|[\fIfloat\fB\|]\fR
791.br
792.ns
793.TP
794\fBcfill \|[\fIfloat\fB\| \|\fIfloat\fB\| \|\fIfloat\fB\|]\fR
795This sets the filling of marks which define an area
796to fill (e.g.  \fIbox\fR, \fIcircle\fR, \fIxbar\fR).
797\fIfill\fB
798defines a gray value, and
799\fIcfill\fB
800defines a color value (see
801\fIgray\fB
802and
803\fIcolor\fB
804above for a description of the units).
805The default is
806\fIfill 0\fB
807(black).
808.TP
809\fBpattern \fItoken\fB \|[\fIfloat\fB\|]\fR
810This defines the how the mark is to be filled.  \fIToken\fR
811may be \fIsolid\fR (the default), \fIstripe\fR, or \fIestripe\fR.  If
812\fIsolid\fR, then the \fIfloat\fR is ignored, and the mark is
813completely filled in with either the gray value defined by
814\fIfill\fR or the color value defined by \fIcfill\fR.
815If \fIstripe\fR, then the mark will be filled with stripes of
816either the gray value defined by \fIfill\fR or the color defined
817by \fIcfill\fR.  The stripes will be rotated by \fIfloat\fR
818degrees.  \fIEstripe\fR differs from \fIstripe\fR only in that
819\fIstripe\fR draws
820stripes on a white background, while \fIestripe\fR simply draws the
821stripes on an empty background.
822.TP
823\fBpoly\fR
824.br
825.ns
826.TP
827\fBnopoly\fR
828.br
829.ns
830.TP
831\fBpfill \|[\fIfloat\fB\|]\fR
832.br
833.ns
834.TP
835\fBpcfill \|[\fIfloat\fB\| \|\fIfloat\fB\| \|\fIfloat\fB\|]\fR
836.br
837.ns
838.TP
839\fBppattern \fItoken\fB \|[\fIfloat\fB\|]\fR
840\fIPoly\fB allows the user to make jgraph treat the curve as a
841closed polygon (or in the case of a bezier, a closed bezier curve).
842\fIpfill\fB, \fIpcfill\fB and \fIppattern\fB  specify the
843filling of the polygon,
844and work like \fIfill\fB, \fIcfill\fB and \fIpattern\fB above.
845The default is \fInopoly\fB.
846.TP
847\fBgmarks \|[\|{\fIfloat\fB\|} \|{\fIfloat\fB\|}\|]*\fR
848\fIGmarks\fB
849is a way for the user to define custom marks.  For each mark on
850\fI(x,y),\fB
851Each pair of
852\fB\|{\fIfloat_x\fB\|}, \|{\fIfloat_y\fB\|}, \fR
853will define a point on the mark (x +
854\fB(\fIfloat_x\fB * \fImarksize_x\fB / 2), y + (\fIfloat_y\fB * \fImarksize_y\fB / 2)).\fR
855  Thus, for example, the
856\fIbox\fR mark could be defined as
857.PP
858.nf
859        gmarks -1 -1 -1 1 1 1 1 -1
860        marktype general
861.fi
862.PP
863The marktypes \fIgeneral\fR, \fIgeneral_nf\fR, \fIgeneral_bez\fR,
864and \fIgeneral_bez_nf\fR, allow the gmarks points to define
865a closed polygon, a line, a closed bezier curve and a
866regular bezier curve respectively (the nf'' stands for
867non-filled'').
868.TP
869\fBpostscript : \|{\fIstring\fB\|}\fR
870.br
871.ns
872.TP
873\fBpostscript {\fItoken\fB\|}\fR
874This allows the user to enter direct postscript as a mark.  It
875automatically sets the marktype to \fIpostscript\fR.  If a string is
876entered, then that string is used as the mark in the jgraph output.
877If a token is entered, then that token must stand for a filename, which
878will be copied to the output once for every mark.  The postscript will
879be set up so that when the string or file is put to the output, (0, 0) of
880the the axes is in the middle of the mark, it is rotated by
881\fImrotate\fB degrees, and scaled by
882(\fImarksize_x\fB / 2), \fImarksize_y\fB / 2).
883Thus, the \fIbox\fR mark could be defined as:
884.PP
885.nf
886        postscript : 1 setlinewidth -1 -1 moveto -1 1 lineto \\
887                  1 1 lineto 1 -1 lineto -1 -1 lineto stroke
888.fi
889.PP
890If the \fImarksize_x\fB is defined to be (0, 0), then jgraph does no
891scaling.  This is useful when the postscript has strings, and the
892user does not want the strings to be scaled.
893.TP
894\fBeps {\fItoken\fB\|}\fR
895This allows the user to include an encapsulated postscript file
896and treat it as a mark.  It automatically sets the marktype to
897\fIeps\fB.  The file will be scaled so that the bounding
898box is \fImarksize\fR units.  Among other things, this allows the
900explained in HINTS AND EXAMPLE GRAPHS below for an example of this feature.
901.TP
902\fBlarrows\fR
903.br
904.ns
905.TP
906\fBrarrows\fR
907.br
908.ns
909.TP
910\fBnolarrows\fR
911.br
912.ns
913.TP
914\fBnorarrows\fR
915\fIRarrows\fB
916specifies to draw an arrow at the end of every line
917segment in the curve.
918\fILarrows\fB
919specifies to draw an arrow at the beginning of every line segment.
920The size of the arrows can be changed by using
921\fIasize.\fB
922The default is
923\fInolarrows\fB
924and
925\fInorarrows\fB.
926  Arrows always go exactly to the point specified, with the exception
927of when the marktype is circle''.  In this case, the arrow goes to
928the edge of the circle.
929.TP
930\fBlarrow\fR
931.br
932.ns
933.TP
934\fBrarrow\fR
935.br
936.ns
937.TP
938\fBnolarrow\fR
939.br
940.ns
941.TP
942\fBnorarrow\fR
943This is analgous to the above, except that with \fIlarrow\fB, the
944only arrow drawn is to the beginning of the first segment in the
945curve, and with \fIrarrow\fB, the only arrow drawn is to the end
946of the last segment.
947.TP
948\fBasize \|[\fIfloat\fB\|] \|[\fIfloat\fB\|]\fR
949This sets the size of the arrows.  The first
950\fB\|[\fIfloat\fB\|] \fR
951controls the arrow's width.  Its units are those of the x-axis.
952The second
953\fB\|[\fIfloat\fB\|] \fR
954controls the arrow's height.  It is in the units of the y-axis.
955Use the -p option of jgraph to see the default values.
956.TP
957\fBafill \|[\fIfloat\fB\|]\fR
958.br
959.ns
960.TP
961\fBafill \|[\fIfloat\fB\|]\fR
962.br
963.ns
964.TP
965\fBapattern \fItoken\fB \|[\fIfloat\fB\|]\fR
966These control the grayness or color of arrowheads.
967\fIAfill\fB,
968\fIacfill\fB
969and
970\fIapattern\fB
971work in the same way as
972\fIfill\fB,
973\fIcfill\fB
974and
975\fIpattern\fB
976described above.  The default is
977\fIafill 0\fB
978(black).
979.TP
980\fBlinetype \|[\fItoken\fB\|]\fR
981This defines the type of the line connecting the points.  Valid
982entries are \fIsolid\fR, \fIdotted\fR, \fIdashed\fR, \fIlongdash\fR,
983\fIdotdash\fR, \fIdotdotdash\fR, \fIdotdotdashdash\fR, \fIgeneral\fR, and
984\fInone\fR.  The default is \fInone\fR.  \fIGeneral\fR lets the user define
985his own linetype using the
986\fIglines\fB
987command described below.  Points are connected in the
988order in which they are inserted using the
989\fIpts\fB
990command.
991.TP
992\fBglines \|[\fIfloat\fB\|]*\fR
993This lets the user specify the exact dashing of a line.  The format
994is as in postscript -- the first number is the length of the first
995dash, the second is the length of the space after the first dash,
996etc.  For example, \fIdotdash\fB could be defined as \fIglines\fB 5 3
9971 3''.
998.TP
999\fBlinethickness \|[\fIfloat\fB\|]\fR
1000This defines the line thickness (in
1001absolute postscript units) of the connecting line.  Default = 1.0.
1002.TP
1003\fBbezier\fR
1004.br
1005.ns
1006.TP
1007\fBnobezier\fR
1008.br
1009.ns
1010\fIBezier\fB
1011specifies to use the curve's points to define successive bezier curves.
1012The first point is the starting point.  The next two are control points
1013for the bezier curve and the next point is the ending point.  If there
1014is another bezier, this ending point is also the beginning point of the
1015next curve.  The next two points are again control points, and the next
1016point is the ending point.  Thus, a bezier must have a total of (3n + 1)
1017points, where n is at least 1.
1018  In bezier curves, marks and arrows only apply to every third point.
1019\fINobezier\fB is the default.
1020
1021.TP
1022\fBclip\fR
1023This specifies that this curve will be clipped -- that is,
1024no points outside of the of axes will be plotted.
1025.TP
1026\fBnoclip\fR
1027This turns off clipping.  If clipping was specified for the
1028entire graph, then
1029\fInoclip\fB
1030has no effect.
1031\fINoclip\fB
1032is the default.
1033.TP
1034\fBlabel\fR
1035This edits the label of this curve for the purposed of
1036drawing a legend.  (see LABEL EDITING COMMANDS and LEGEND EDITING
1037COMMANDS).  Unless the legend entry is
1038\fIcustom\fB,
1039setting any label attribute except for the text itself
1040will have no effect.
1041.PD
1042.RE
1043.LP
1044.TP
1045.B LABEL EDITING COMMANDS
1046The following commands are used for editing
1047labels.  Unless stated otherwise, the defaults are written with each
1048command.  Label editing terminates when one of these tokens is not
1049given.
1050.RS
1051.TP
1052\fB: \|{\fIstring\fB\|}\fR
1053This sets the string of the label.  If no string is
1054set, the label will not be printed.
1055.TP
1056\fBx \|[\fIfloat\fB\|]\fR
1057.br
1058.ns
1059.TP
1060\fBy \|[\fIfloat\fB\|]\fR
1061This sets the x or y coordinate of the
1062label.  Units are the units of the x and y axes respectively.
1063.TP
1064\fBfont \|[\fItoken\fB\|]\fR
1065This sets the font.  Default is usually Times-Roman''.
1066.TP
1067\fBfontsize \|[\fIfloat\fB\|]\fR
1068This sets the fontsize in points.  Default is usually 9.
1069.TP
1070\fBlinesep \|[\fIfloat\fB\|]\fR
1071This sets the distance between lines in multilined labels.  Units are points.
1072The default is the fontsize.
1073.TP
1074\fBhjl\fR
1075.br
1076.ns
1077.TP
1078\fBhjc\fR
1079.br
1080.ns
1081.TP
1082\fBhjr\fR
1083These set the horizontal justification to left,
1084center, and right, respectively.  Default =
1085\fIhjc.\fB
1086.TP
1087\fBvjt\fR
1088.br
1089.ns
1090.TP
1091\fBvjc\fR
1092.br
1093.ns
1094.TP
1095\fBvjb\fR
1096These set the vertical justification to top
1097center, and bottom, respectively.  Default =
1098\fIvjb.\fB
1099.TP
1100\fBrotate \|[\fIfloat\fB\|]\fR
1101This will rotate the string
1102\fB\|[\fIfloat\fB\|] \fR
1103degrees.  The point of rotation is defined by the
1104\fIvj\fB
1105and
1106\fIhj\fB
1107commands.  For example, to rotate 90 degrees about the center of a string,
1108one would use
1109\fIvjc hjc rotate 90.\fB
1110.TP
1111\fBlgray \|[\fIfloat\fB\|]\fR
1112.br
1113.ns
1114.TP
1115\fBlcolor \|[\fIfloat\fB \fIfloat\fB \fIfloat\fB\|]\fR
1116These control the color or the grayness of the label.  It works just as
1117\fIgray\fB
1118and
1119\fIcolor\fB
1120do for curves and axes.  The default depends on the context.  For example,
1121for strings and the title, the default is black.  For axis labels and hash
1122labels, the default is the color of the axis.  For text as marks, the
1123default is the curve color.
1124.PD
1125.RE
1126.LP
1127.TP
1128.B LEGEND EDITING COMMANDS
1129These commands allow the user to alter the
1130appearance of the legend.  Legends are printed out for each curve
1131having a non-null label.  The legend entries are printed out
1132in the order of ascending curve numbers.
1133Legend editing terminates when a graph command or top level command
1134is issued.
1135
1136In earlier versions of jgraph (before version 8.0), the
1137characteristics of each legend entry were set in the label portion
1138of the entry's curve.  Thus, for example, if you wanted each entry's
1139fontsize to be 18, you had to set it in each entry's curve.  Now,
1140default legend entry characteristics are set using the
1141\fIdefaults\fB
1142keyword.  Unless a
1143\fIcustom\fB
1144legend is specified, these default values override any values set in
1145the entry's curve.  Thus, to get all entries to have a fontsize of
114618, it must be set using
1147\fIdefaults fontsize 18.\fB
1148
1149If legend editing seems cryptic, try the following example:
1150.PP
1151.nf
1152        newgraph
1153        newcurve marktype box linetype solid label : Solid box
1154          pts 0 0 1 1 2 1 3 1
1155        newcurve marktype circle linetype dotted label : Dotted circle
1156          pts 0 1 1 2 2 2 3 2
1157        newcurve marktype x linetype dashed label : Dashed x
1158          pts 0 2 1 3 2 3 3 3
1159        legend defaults
1160          font Times-Italic fontsize 14 x 1.5 y 3.5 hjc vjb
1161.fi
1162.PP
1163The legend of this graph should be centered over the top of the graph,
1164and all legend entries should be 14pt Times-Italic.
1165.RS
1166.TP
1167\fBon\fR
1168.br
1169.ns
1170.TP
1171\fBoff\R
1172These turn printing of the legend on and off.  The default is on
1173(but, of course, if there are no curve labels defined, there will
1174be no legend).
1175.TP
1176\fBlinelength \|[\fIfloat\fB\|]\fR
1177This sets the length of the line printed in
1178front of legend entries corresponding to curves which have lines.
1179Units are those of the x axis, unless the x axis is logarithmic, in
1180which case the units are inches.  The default may be gotten using the
1181\fB\-p\fR
1182option.
1183.TP
1184\fBlinebreak \|[\fIfloat\fB\|]\fR
1185This sets the vertical distance between
1186individual legend entries.  Units are those of the y axis, unless the
1187y axis is logarithmic, in which case the units are inches.  The
1188default may be gotten using the
1189\fB\-p\fR
1190option.
1191.TP
1192\fBmidspace \|[\fIfloat\fB\|]\fR
1193This sets one of two things.  If any of the
1194legend entries have lines in them, then this sets the distance
1195between the end of the line and the legend entry text.  Otherwise,
1196this sets the distance between center of the mark and the legend
1197entry text.  Units are those of the x axis, unless the x axis is
1198logarithmic, in which case the units are inches.  The default may be
1199gotten using the
1200\fB\-p\fR
1201option.
1202.TP
1203\fBdefaults\fR
1204This lets the user change the attributes of all legend entries.
1205The defaults are editted as a label (see LABEL EDITING COMMANDS).
1206A few of the label fields have special meanings:  The \fI:\fR field
1207is ignored.  The \fIx\fR and \fIy\fR fields define where the label
1208will be printed.  The \fIhj\fR and \fIvj\fR fields define the justification
1209of the legend about the \fIx\fR and \fIy\fR point.  Thus, if \fIx\fR is 10
1210and \fIy\fR is 15, and \fIhjc  vjb\fR are specified, then the legend will
1211be centered horizontally about x=10, and the bottom of the legend
1212will be placed on y=15.  This is analagous to label plotting.
1213The \fIrotate\fR field is also analagous to label plotting.
1214
1215Defaults are as follows.  \fIRotate\fR is 0.  \fIfont\fR is Times-Roman''
1216and \fIfontsize\fR is 9.  The color is black.  Default justification is
1217\fIhjl\fR and \fIvjc\fR.  The default \fIx\fR and \fIy\fR values are set
1218according to the \fIhj\fR and \fIvj\fR fields.  See the
1219\fB\-p\fR
1220option.
1221.TP
1222\fBleft\fR
1223.br
1224.ns
1225.TP
1226\fIright\fB
1227These will automatically produce a legend to the left or
1228the right of the graph.
1229\fILeft\fB
1230is equivalent to
1231\fIdefaults hjr vjc\fB
1232and
1233\fIright\fB
1234is equivalent to
1235\fIdefaults hjl vjc.\fB
1236.TP
1237\fBtop\fR
1238.br
1239.ns
1240.TP
1241\fBbottom\fR
1242These will automatically produce a legend on the top or
1243the bottom of the graph.
1244\fITop\fB
1245is equivalent to
1246\fIdefaults hjl vjb\fB
1247 and
1248\fIbottom\fB
1249is equivalent to
1250\fIdefaults hjl vjt.\fB
1251.TP
1252\fBx \|[\fIfloat\fB\|]\fR
1253.br
1254.ns
1255.TP
1256\fBy \|[\fIfloat\fB\|]\fR
1257These are included mainly for backward compatability to earlier
1258versions of jgraph.  Setting
1259\fIx\fB
1260and
1261\fIy\fB
1262is equivalent to defaults x
1263\fIfloat\fB
1264y
1265\fIfloat\fB
1266hjl vjt''
1267.TP
1268\fBcustom\fR
1269This lets the user control where each individual legend
1270entry goes.  The values of the
1271\fIdefaults\fB
1272fields are ignored, and instead, the values of the curve's
1273labels are used.  All justifications have defined results, except
1274for
1275\fIhjc\fB.
1276Similarly, rotation other than 0 is likely to produce bad effects.
1277.PD
1278.RE
1279.LP
1280.TP
1282These are more advanced commands for
1283editing an axis.  This includes drawing explicit hash marks and
1284labels, moving the hash marks, axes, and labels, not drawing the hash
1285marks, labels, axes, etc.
1286.RS
1287.TP
1288\fBgray \|[\fIfloat\fB\|]\fR
1289.br
1290.ns
1291.TP
1292\fBcolor \|[\fIfloat\fB \fIfloat\fB \fIfloat\fB\|]\fR
1293These specify either the grayness of the axis or its color.  Values
1294for
1295\fIgray\fB
1296should be from 0 (black) to 1 (white).  Values for
1297\fIcolor\fB
1298should also be from 0 to 1.  They are RGB values, and thus define the
1299amount of red, green and blue in the axis respectively.  Specifying
1300color nullifies the gray value, and vice versa.  The default is
1301\fIgray 0\fB.
1302These values affect every part of the axis:  the label,
1303the hash marks and labels, the axis line and the grid lines.
1304.TP
1305\fBgrid_gray \|[\fIfloat\fB\|]\fR
1306.br
1307.ns
1308.TP
1309\fBgrid_color \|[\fIfloat\fB \fIfloat\fB \fIfloat\fB\|]\fR
1310.br
1311.ns
1312.TP
1313\fBmgrid_gray \|[\fIfloat\fB\|]\fR
1314.br
1315.ns
1316.TP
1317\fBmgrid_color \|[\fIfloat\fB \fIfloat\fB \fIfloat\fB\|]\fR
1318These allow the user to define the grayness or color of the
1319gridlines and the mgridlines to be different from those of the
1320axis lines.
1321The default
1322\fIgrid_gray\fB
1323and
1324\fIgrid_color\fB
1325is the same as the axis's
1326\fIgray\fB
1327and
1328\fIcolor\fB.
1329The default
1330\fImgrid_gray\fB
1331and
1332\fImgrid_color\fB
1333is the same as
1334\fIgrid_gray\fB
1335and
1336\fIgrid_color\fB.
1337.TP
1338\fBhash_at \|[\fIfloat\fB\|]\fR
1339Draw a hash mark at this point.  No label is
1341.TP
1342\fBmhash_at \|[\fIfloat\fB\|]\fR
1343Draw a minor hash mark at this point.
1344.TP
1345\fBhash_label\fR
1346Edit a hash label (see HASH LABEL EDITING COMMANDS).
1347.TP
1348\fBhash_labels\fR
1349Edit the default characteristics of the hash labels.
1350This is so that the user can change the fontsize, justification,
1351etc., of the hash labels.  Editing
1352\fIhash_labels \fB
1353is just like editing
1354normal labels (see LABEL EDITING COMMANDS), except that the
1355\fI:,\fB
1356\fIx,\fB
1357and
1358\fIy\fB
1359values are all ignored. Defaults for hash labels are as
1360follows: Fontsize=9, Font=Times-Roman'', Justification is dependent
1361on whether it is the x or y axis and whether
1362\fIhash_scale\fB
1363is positive or negative.
1364.TP
1365\fBhash_scale \|[\fIfloat\fB\|]\fR
1366This is to change the size and orientation of
1367the hash marks.  Default = -1.0.  Changing this to -2.0 will double
1368the length of the hash marks.  Changing this to +1.0 will make the
1369hash marks come above or to the right of the axis.
1370.TP
1371\fBdraw_hash_marks_at \|[\fIfloat\fB\|]\fR
1372By default, the hash marks are drawn
1373either above or below the axis.  This command changes where they are
1374drawn.
1375\fIHash_scale\fB
1376still determines whether they are drawn above or
1377below this point, and their size.
1378.TP
1379\fBdraw_hash_labels_at \|[\fIfloat\fB\|]\fR
1380By default, the hash labels are
1381drawn either above or below the hash marks (again, this is dependent
1382on
1383\fIhash_scale\fB).
1384This command changes where they are drawn.
1385Justification and fontsize, etc., can be changed with the
1386\fIhash_labels\fB
1387command.
1388.TP
1389\fBauto_hash_marks\fR
1390.br
1391.ns
1392.TP
1393\fBno_auto_hash_marks\fR
1394This toggles whether or
1395not
1396\fBjgraph \fR
1397will automatically create hash marks according to
1398\fIhash,\fB
1399\fImhash\fB
1400and
1401\fIshash\fB
1402(or
1403\fIlog_base\fB
1404and
1405\fImhash\fB
1406for logarithmic axes).
1407The default is
1408\fIauto_hash_marks.\fB
1409.TP
1410\fBauto_hash_labels\fR
1411.br
1412.ns
1413.TP
1414\fBno_auto_hash_labels\fR
1415This toggles whether or
1416not
1417\fBjgraph \fR
1418will automatically create hash labels for the
1419\fIauto_hash_marks\fB.
1420Default =
1421\fIauto_hash_labels\fB.
1422.TP
1423\fBdraw_axis\fR
1424.br
1425.ns
1426.TP
1427\fBno_draw_axis\fR
1428This toggles whether or not the axis
1429line is drawn.  Default =
1430\fIdraw_axis.\fB
1431.TP
1432\fBdraw_axis_label\fR
1433.br
1434.ns
1435.TP
1436\fBno_draw_axis_label\fR
1437This toggles whether or
1438not the axis label (as editted by the
1439\fIlabel\fB
1440command) is drawn.
1441Default =
1442\fIdraw_axis_label.\fB
1443.TP
1444\fBdraw_hash_marks\fR
1445.br
1446.ns
1447.TP
1448\fBno_draw_hash_marks\fR
1449This toggles whether or
1450not the hash marks (both automatic and those created with
1451\fIhash_at\fB
1452and
1453\fImhash_at\fB)
1454are drawn.  Default =
1455\fIdraw_hash_marks.\fB
1456.TP
1457\fBdraw_hash_labels\fR
1458.br
1459.ns
1460.TP
1461\fBno_draw_hash_labels\fR
1462This toggles whether or
1463not the hash labels are drawn.  Default =
1464\fIdraw_hash_labels.\fB
1465.PD
1466.RE
1467.LP
1468.TP
1469.B HASH LABEL EDITING COMMANDS
1470Hash labels are simply strings printed
1471along the appropriate axis.  As a default, they are printed at the
1472place denoted by the most recent
1473\fIhash_at\fB
1474or
1475\fImhash_at\fB
1476for this
1477axis, but this can be changed by the
1478\fIat\fB
1479command.  If there has been
1480no
1481\fIhash_at\fB
1482or
1483\fImhash_at,\fB
1484then an
1485\fIat\fB
1486command must be given, or
1487there will be an error.  Hash editing terminates when either one of
1488these commands is not given.
1489.RS
1490.TP
1491\fB: \|{\fIstring\fB\|}\fR
1492This sets the string of the hash label (see
1493\fBStrings\fR
1494above under THE DESCRIPTION LANGUAGE).
1495.TP
1496\fBat \|[\fIfloat\fB\|]\fR
1497This sets the location of the hash label along the
1498current axis.
1499.PD
1500.RE
1501.LP
1502.SH FUNCTION PLOTTING AND OTHER NON-INHERENT FEATURES
1503Although
1504\fBjgraph \fR
1505doesn't have any built-in functions for interpolation
1506or function plotting, both can be effected in
1507\fBjgraph \fR
1508with a little outside help:
1509.TP
1510\fBFunction plotting\fR
1511With the
1512\fIinclude\fB
1513and
1514\fIshell\fB
1515statement, it's easy to
1516create a file of points of a function with a c or awk program, and
1517include it into a graph.  See the section HINTS AND EXAMPLE GRAPHS
1518for an example of a sin graph produced in this manner.
1519.TP
1520\fBPoint interpolation\fR
1521Point interpolation is essentially the same as
1522function plotting, and therefore is left out of
1523\fBjgraph.  \fR
1524The UNIX spline(1) routine is a simple way to get interpolation
1525between points.  See bailey.jgr described below.
1526Maybe in a future release.
1527.SH HINTS AND EXAMPLE GRAPHS
1528\fBJgraph \fR
1529should be able to draw any kind of scatter/line/bar graph that
1530a user desires.  To embellish the graph with extra text, axes, lines,
1531etc., it is helpful to use
1532\fIcopygraph.\fB
1533The following example graphs show a few examples of different features
1534of jgraph.  They should be in the directory JGRAPH_DIR.
1535.sp
1536- acc.jgr is a simple bar graph.  Acc.tex is also included to show
1537how one can include the output of jgraph in a LaTeX file.  To get
1538this to work, you might have to substitute the entire pathname of
1539the file acc.jps in the acc.tex file.
1540.sp
1541- g8.jgr is a simple graph with some plotted text.
1542- g8col.jgr shows how to produce a color background -- it is
1543  the same as g8.jgr only all on a yellow background.
1544- ebars.jgr is a simple graph with error bars.
1545- sin.jgr shows how a sin function can be plotted using a simple c
1546program to produce the sin wave.  Moreover, this file shows a use of
1547\fIcopygraph\fB
1548to plot an extra x and y axis at the 0 point.
1549.sp
1550- sin1.jgr is a further extension of sin.jgr only with one x and y
1551axis at 0, but with the axis labels at the left and the bottom of the
1552graph.
1553.sp
1554- sin2.jgr is a different sin wave with a logarithmic x axis.
1555.sp
1556- sin3.jgr shows how a bizarre effect can be gotten by sorting the
1557points in a different manner.
1558.sp
1559- bailey.jgr shows how to use the UNIX spline(1) routine to get
1560interpolation between points.
1561.sp
1562- gpaper.jgr shows how you can get jgraph to easily produce graph paper.
1563.sp
1564- g9n10.jgr contains two graphs with complicated legends.  It
1565contains a description of how the legend was created.
1566.sp
1567- ex1.jgr and ex2.jgr are two examples which were figures 1 and
1568two in an extended abstract for a paper about jgraph.
1569.sp
1570- mab2.jgr is a graph created by Matt Blaze which shows how a
1571complicated output graph can be quite concisely and simply stated.
1572In this graph, the x axis is a time line.  It shows usage of the
1573\fIhash_label\fB
1574and
1575\fIhash_labels\fB
1576commands, as well as displaying how jgraph lets you extract data from
1577output files with awk.
1578.sp
1579- nr.jgr is an example of a rather complicated bar graph with
1580stripe-filled bars.  It was created by Norman Ramsey.
1581.sp
1582- hypercube.jgr shows an interesting use of jgraph
1583for picture-drawing.
1584.sp
1585- ad.jgr is an example which shows how one can include jgraph
1586output as jgraph input.  The file uses the \fIeps\fR token to
1587include cube.jgr, a jgraph drawing of an Intel hypercube, and disk.jgr,
1588a jgraph drawing of a disk, in a picture.
1589.sp
1590- alb.jgr is another use of jgraph for picture drawing.  This file
1591was created by an awk script which Adam Buchsbaum wrote to draw
1592trees and graphs.
1593.sp
1594- wortman.jgr is a neat graph of processor utilization written
1595by Dave Wortman for SIGPLAN '92.  It was created by an awk script,
1596which processed the data and emitted the jgraph.
1597.sp
1598To view these graphs, use jgraph -P, and view the resulting output
1599file with
1600\fIgs,\fB
1601or a similar postscript viewer.
1602To make a hard copy of these graphs, pipe the output of jgraph
1603-P directly to
1604\fIlpr.\fB
1605
1606.SH USING JGRAPH TO DRAW PICTURES
1607As hypercube.jgr and alb.jgr show, jgraph can be used as a postscript
1608preprocessor to make drawings.  There are two advantages
1609using jgraph to draw pictures instead of using standard drawing tools like
1610\fIxfig\fB,
1611\fIfigtool\fB,
1612or
1613\fIidraw\fB.
1614The first is that with jgraph, you know exactly where strings, lines,
1615boxes, etc, will end up, because you plot them explicitly.  The second
1616advantage is that for iterative drawings, with lots of patters, you
1617can combine jgraph with awk or c or any other programming language
1618to get complex output in a simple way.  Most what-you-see-is-what-you-get
1619(WYSIWYG) drawing tools cannot do this.
1620
1621The major disadvantage of using jgraph to draw pictures is that jgraph
1622is not WYSIWYG.  You have to set up axes and plot points, lines and
1623strings.  It's all a matter of taste.
1624
1625If you'd like to see some more complex pictures drawn with jgraph, as
1626well as some hints to make picture-drawing easier, send me email
1627(jsp@princeton.edu).
1628
1629.SH EMBEDDING THE OUTPUT IN LATEX
1631into LaTeX has been as follows:
1632.PP
1633.nf
16341.  Toward the beginning of my LaTeX file, I've had \\input{psfig}''
16352.  Where I've wanted my file, I've put:
1636
1637    \\begin{figure}
1638    \\centerline{\\psfig{figure=<path-name>/<filename-of-jgraph-output>}}
1639    \\end{figure}
1640
1641    Some versions of dvips or dvi2ps work without the path-name.  Others
1642    require that the path-name be present.
1643
16443.  After running latex on the file, do
1645
1646    lpr -d file.dvi
1647
16484.  If that doesn't work, try dvips-ing the file and printing the postscript.
1649
1650.fi
1651.PP
1652.SH BUGS
1653Logarithmic axes cannot contain points <= 0.  If I have
1654enough complaints to convince me that this is a bug, I'll try to fix it.
1655.sp
1656There is no real way to make the axes such that they decrease from
1657left to right or low to high -- or at least not without writing your
1658own hash labels.
1659.sp
1660There may well be loads of other bugs.  Send to jsp@princeton.edu.
1661.sp
1662
1663This is $Revision: 8.3$.
Note: See TracBrowser for help on using the repository browser.