home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-07-13 | 57.8 KB | 1,943 lines |
- Newsgroups: comp.sources.misc
- From: jsp@Princeton.EDU (James Plank)
- Subject: v31i031: jgraph - A filter for plotting postscript graphs v8.0, Part01/07
- Message-ID: <csm-v31i031=jgraph.101354@sparky.IMD.Sterling.COM>
- X-Md4-Signature: f652ce4bfac2b966406e883b894c4f07
- Date: Tue, 14 Jul 1992 15:14:37 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: jsp@Princeton.EDU (James Plank)
- Posting-number: Volume 31, Issue 31
- Archive-name: jgraph/part01
- Environment: UNIX, VMS, postscript
- Supersedes: jgraph: Volume 16, Issue 20
-
- Jgraph version 8.0: Fri Jul 3 15:15:54 EDT 1992
-
- This is a complete reposting of jgraph. For those of you who don't know what
- jgraph is, the description is below. Those who do, please skip to
- the CHANGES line...
-
- 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
- graphs, and/or bar graphs, and embedding the output into LaTeX, or
- any other text processing system which can read postscript.
-
- The graph description language is simple enough to get nice looking
- 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 DECstations,
- sun3's, and sparc's (and is being used on many other types
- of machines, including those running VMS and DOS).
-
- 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.
-
- Jgraph is also available from netlib, a mail archive server.
- To acquire jgraph from netlib, send a mail message to
- netlib@ornl.gov with nothing but the text:
-
- send jgraph.shar from jgraph
-
- It will respond by mailing you messages which comprise
- the file jgraph.shar. To extract jgraph.shar from these
- messages, first save each one into a file. Then for each
- of these files, strip off all the lines up to but not including
- the '#!/bin/sh' line. Then run /bin/sh on each file. When
- you're done, you should be left with the file jgraph.shar, upon
- which you then run /bin/sh -- this will produce all the jgraph
- source files.
-
- 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
- Email: jsp@princeton.edu
- USmail: Department of Computer Science
- Princeton University
- 35 Olden St.
- Princeton, NJ 08544-2087
- CHANGES
-
- Before I get into changes, I'm interested in knowing just how many
- people are using jgraph at different sites. I know it's been
- ported to at least 40 sites, but I really have little idea of the
- user base. So, if you're a jgraph user please just send me an email
- message. If you've installed jgraph at a site, I'd also like to have
- an idea of how many users you have at that site, and what machines
- you've ported it to. Thanks so much.
-
- Ok, here are the major changes. If you've been using jgraph, these changes
- shouldn't affect your old graphs, except in the case of fancy legends,
- where you might need to update them. As always, the man page has been
- updated to reflect all the changes.
-
- - Added landscape mode to the command line arguments (option is -L).
- - Added color to all labels and strings (see lgray and lcolor)
- - Allowed multiline strings (i.e. labels can now have newlines in them).
- (see "Strings")
- - Allowed error bars to be printed automatically in a curve
- (see x_epts and y_epts)
- - Allowed postscript marks as well as a postscript preamble and epilogue
- (see preamble, epilogue and postscript)
- - Allowed the points of a curve to define a polygon
- (see poly, pfill, and pcfill)
- - Allowed gmarks to define a polygon or bezier or closed bezier
- (see marktype)
- - Allowed marks to be rotated (see mrotate)
- - Put in rarrow and larrow, for when you only want an arrow at the beginning
- or ending of a curve.
- - Fixed up legends. Now you can edit default attributes for all labels in the
- legend at once, as well as specify justification and rotation for the legend
- as a whole (see LEGEND EDITING COMMANDS).
- - Put in grid_gray, grid_color, mgrid_gray and mgrid_color, so that grid lines
- can be different grayness/color from the axis without using copygraph.
- - Fixed up custom legends so that all values of hj and vj except for hjc
- produce reasonable results.
- - Put in afill and acfill for controlling the color of arrows. This is
- mainly so that the color of arrows isn't bound to be the color of the
- curve's marks.
-
- Another change -- jgraph has been installed in netlib, which is basically
- a mail archive for programs. So, if you would like to retrieve the most
- current verion of jgraph and you can't ftp to princeton.edu, then please
- use netlib. Directions for using netlib are in the jgraph description above.
-
- As always, please let me know of bugs and/or comments.
-
- Take it Easy,
-
- Jim
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # The tool that generated this appeared in the comp.sources.unix newsgroup;
- # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
- # Contents: README ebars.jgr jgraph.1 mab2.times
- # Wrapped by kent@sparky on Sun Jul 12 20:04:01 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 1 (of 7)."'
- if test -f 'README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README'\"
- else
- echo shar: Extracting \"'README'\" \(2179 characters\)
- sed "s/^X//" >'README' <<'END_OF_FILE'
- X$Revision: 8.0 $
- X
- XJgraph takes the description of a graph or graphs in the standard
- Xinput, and produces a postscript file on the standard output. Jgraph
- Xis ideal for plotting any mixture of scatter point graphs, line
- Xgraphs, and/or bar graphs, and embedding the output into LaTeX, or
- Xany other text processing system which can read postscript.
- X
- XThe graph description language is simple enough to get nice looking
- Xgraphs with a minimum of effort, yet powerful enough to give the user
- Xthe flexibility to tailor the appearance of the graph to his or her
- Xindividual preferences. This includes plotting multiple graphs and
- Xlaying them out separately on the page (or pages).
- X
- XThe program is written in C, and shouldn't take anything too fancy
- Xor machine-dependent. It has been tested on DECstations,
- Xsun3's, and sparc's (and is being used on many other types
- Xof machines, including those running VMS and DOS).
- X
- XThere is a makefile, a man page (in jgraph.1), source code, and
- Xexample graphs.
- X
- XJgraph is available via anonymous ftp to princeton.edu, in the
- Xfile jgraph.Z. This file is a compressed shell bundle file.
- X
- XJgraph is also available from netlib, a mail archive server.
- XTo acquire jgraph from netlib, send a mail message to
- Xnetlib@ornl.gov with nothing but the text:
- X
- Xsend jgraph.shar from jgraph
- X
- XIt will respond by mailing you messages which comprise
- Xthe file jgraph.shar. To extract jgraph.shar from these
- Xmessages, first save each one into a file. Then for each
- Xof these files, strip off all the lines up to but not including
- Xthe '#!/bin/sh' line. Then run /bin/sh on each file. When
- Xyou're done, you should be left with the file jgraph.shar, upon
- Xwhich you then run /bin/sh -- this will produce all the jgraph
- Xsource files.
- X
- XThere is also a mailing list in which I inform users directly
- Xabout bug fixes. This is for those who don't read comp.sources.misc,
- Xor those who would like to hear about minor bug fixes which I
- Xhaven't posted as a patch to comp.sources.misc.
- X
- XPlease send me comments and/or bug reports.
- X
- XAuthor: Jim Plank
- XEmail: jsp@princeton.edu
- XUSmail: Department of Computer Science
- X Princeton University
- X 35 Olden St.
- X Princeton, NJ 08544-2087
- END_OF_FILE
- if test 2179 -ne `wc -c <'README'`; then
- echo shar: \"'README'\" unpacked with wrong size!
- fi
- # end of 'README'
- fi
- if test -f 'ebars.jgr' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'ebars.jgr'\"
- else
- echo shar: Extracting \"'ebars.jgr'\" \(605 characters\)
- sed "s/^X//" >'ebars.jgr' <<'END_OF_FILE'
- X(* This graph shows the use of y_epts to get error bars onto the graph.
- X It plots the curve y = 2x plus or minus x/2 for integer x values
- X from from 1 to 10 *)
- X
- Xnewgraph
- Xxaxis min 0 max 10 label : x
- Xyaxis min 0 max 25 label : y = 2x +- x/2
- X
- Xnewcurve marktype circle linetype dotted
- X (* These points could equally be generated by:
- X y_epts shell : echo "" |\
- X awk '{ for (i = 1; i < 11; i++) print i, 2*i, 2*i-i/2.0, 2*i+i/2.0}'
- X *)
- X y_epts
- X 1 2 1.5 2.5
- X 2 4 3 5
- X 3 6 4.5 7.5
- X 4 8 6 10
- X 5 10 7.5 12.5
- X 6 12 9 15
- X 7 14 10.5 17.5
- X 8 16 12 20
- X 9 18 13.5 22.5
- X 10 20 15 25
- END_OF_FILE
- if test 605 -ne `wc -c <'ebars.jgr'`; then
- echo shar: \"'ebars.jgr'\" unpacked with wrong size!
- fi
- # end of 'ebars.jgr'
- fi
- if test -f 'jgraph.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'jgraph.1'\"
- else
- echo shar: Extracting \"'jgraph.1'\" \(44248 characters\)
- sed "s/^X//" >'jgraph.1' <<'END_OF_FILE'
- X.\" SCCSID: @(#)jgraph.1 1.1 10/23/89
- X.\" SCCSID: @(#)jgraph.1 1.1 10/23/89
- X.TH jgraph 1
- X.SH NAME
- Xjgraph \- filter for graph plotting to postscript
- X.SH SYNTAX
- X.B jgraph
- X[\-\fIp\fR\|]
- X[\-\fIP\fR\|]
- X[\-\fIL\fR\|]
- X[\-\fIcomments\fR\|]
- X.SH DESCRIPTION
- X\fBJgraph\fR
- Xtakes the description of a graph or graphs in the standard
- Xinput, and produces a postscript file on the standard output.
- X\fBJgraph\fR
- Xis ideal for plotting any mixture of scatter point graphs, line
- Xgraphs, and/or bar graphs, and embedding the output into LaTeX, or
- Xany other text processing system which can read postscript.
- X.sp
- XThe graph description language is simple enough to get nice looking
- Xgraphs with a minimum of effort, yet powerful enough to give the user
- Xthe flexibility to tailor the appearance of the graph to his or her
- Xindividual preferences. This includes plotting multiple graphs and
- Xlaying them out separately on the page (or pages).
- X.sp
- XAs an example, if the user wanted to simply plot the points (2,3),
- X(4,5), (1,6), the following would be enough of a specification file:
- X.PP
- X.nf
- X newgraph
- X newcurve pts 2 3 4 5 1 6
- X.fi
- X.PP
- XNow, if the user wanted to spruce the graph up by adding labels to
- Xthe axes, connecting the points, and titling the graph, then the
- Xinput could change to:
- X.PP
- X.nf
- X newgraph
- X newcurve pts 2 3 4 5 1 6 linetype solid
- X xaxis label : X axis
- X yaxis label : Y axis
- X title : This is an example graph
- X.fi
- X.PP
- XIf the user instead wanted this to be a bar graph with different
- Xendpoints on the axes, he/she could simply change the input to:
- X.PP
- X.nf
- X newgraph
- X xaxis min 0 max 5 label : X axis
- X yaxis min 0 max 6 label : Y axis
- X newcurve pts 2 3 4 5 1 6 marktype xbar
- X title : This is an example bar graph
- X.fi
- X.PP
- XThere are many more features of the description language, which are
- Xdescribed below in the next section. Features which are not embedded
- Xwithin the description language are: line and function interpolation,
- Xfunction plotting, and pie graphs. The latter is impossible to do
- Xwith the aid of
- X\fBjgraph, \fR
- Xhowever, the others can be effected with
- X\fBjgraph \fR
- Xmixed with awk or c. See
- XFUNCTION PLOTTING AND OTHER NON-INHERENT FEATURES
- Xbelow.
- X.sp
- XAlso below is a section
- XHINTS AND EXAMPLE GRAPHS, which may give good
- Xideas on how to use
- X\fBjgraph \fR
- Xmore effectively.
- X.SH OPTIONS
- X.TP
- X.B \-P
- XThe
- X\fB\-P\fR
- Xoption produces postscript which can be piped directly to
- X\fBlpr,\fR
- Xwhich can be displayed in an Xwindows environment with
- X\fBgs\fR
- X(ghostscript).
- XWithout this option, the output should be embedded within
- X\fBLaTeX\fR
- Xor a similar text processing system.
- X.TP
- X.B \-L
- XThe
- X\fB\-L\fR
- Xoption produces a landscape plot.
- X.TP
- X.B \-p
- XThe
- X\fB\-p\fR
- Xoption re-prints the input on the standard output, only
- Xwith all the defaults made explicit. This is useful for letting the
- Xuser do his/her own special formatting, as it shows the explicit
- Xvalues that the defaults assume, so that they can be manipulated.
- X.TP
- X.B \-comments
- XThis option makes jgraph put comments into the output postscript. These
- Xmake it easier for the user to wade through the final postscript if
- Xnecessary.
- X.SH THE DESCRIPTION LANGUAGE
- XThe description language is essentially keywords followed by
- Xattributes. All keywords and attributes except for string attributes
- Xare tokens -- non-white-space characters surrounded by white-space.
- XSpecial tokens are
- X``(*'', ``*)'', ``include'', ``:'', and ``shell'', which denote
- Xcomments, include-file statements, string identifiers, and shell-include
- Xstatements:
- X.TP
- X.B Comments
- XComments are surrounded by the tokens ``(*'' ``*)'' as in
- XModula-2 (except that here, the tokens must be surrounded by white-
- Xspace). Comments may be nested. If the comment runs to the end of a
- Xfile, the last ``*)'' may be omitted.
- X.TP
- X.B Include\-file statements
- XThe token following an ``include'' token is
- Xexpected to be a file name. The result of the statement is to
- Xinclude the contents of the file at that point. Include-file
- Xstatments can be nested within included files, and within shell
- Xincludes.
- X.TP
- X.B Strings
- XIn places where strings are required (as in graph and
- Xcurve labels), they are denoted by the token ``:''. The second
- Xcharacter after the ``:'' starts the string, and the next newline
- Xcharacter terminates it.
- XThus, the string ``Graph #1'' can be denoted as:
- X.nf
- X
- X : Graph #1<newline>
- X
- Xor
- X
- X :<newline>
- X Graph #1<newline>
- X
- X.fi
- XOne can get multiline strings by making
- Xa backslash the last character before the newline on all but the
- Xlast line. Notice that in strings white-space is not ignored.
- XThis way of denoting strings allows the user to embed leading and
- Xtrailing spaces, as well as the null string. For example, the
- Xnull string ``'' is represented by:
- X.nf
- X
- X : <newline>
- X
- X.fi
- XOnce a string has been started, it may contain any character.
- XSpecifically, it may contain the sequence ``(*'', ``shell'',
- Xor ``include'' without starting a comment or including a file.
- XEach line of a string must contain less than 1000 characters. Otherwise
- Xstring sizes are limited only by the size of memory.
- X.TP
- X.B Shell\-include statements
- XShell include statements are of the form ``shell'', ``:'', and then
- Xa string. The result of the statement is that the string is executed
- X(using popen, which passes the string to sh), and the standard
- Xoutput is included at that point. Shell-includes can be freely
- Xnested within include-files and other shell-includes. Shell
- Xcommands may be more than one line, but must not exceed 1000 characters.
- XThe shell statement is not (yet) available on VMS.
- X.TP
- X.B Notation
- XIn the descriptions below:
- X.RS
- X.TP
- X\fBtk \|{\fIinteger\fB\|}\fR
- Xmeans that token
- X\fBtk \fR
- Xmust be followed by an integer.
- X.TP
- X\fBtk \|[\fIinteger\fB\|]\fR
- Xmeans that
- X\fBtk\fR
- Xmay be followed by an integer, but doesn't have to. In most cases, if
- X\fBtk\fR
- Xis not followed by an integer, then the command denoted by
- X\fBtk \fR
- Xis ignored.
- X.TP
- X\fBtk \|[\|{\fIinteger\fB\|} \|{\fIinteger\fB\|}\|]*
- Xmeans that
- X\fBtk\fR
- Xmust be
- Xfollowed by an even number of integers.
- X.PD
- X.LP
- XSupported types other than
- Xinteger are:
- X\fB\|{\fIfloat\fB\|} \fR
- Xfor floating point entries,
- X\fB\|{\fItoken\fB\|} \fR
- Xfor any
- Xtoken, and
- X\fB\|{\fIstring\fB\|} \fR
- Xfor a string as defined above.
- X.RE
- X.TP
- X.B TOP-LEVEL DESCRIPTION COMMANDS
- X.RS
- X.TP
- X.B newgraph
- XThis starts editing a new graph (see GRAPH EDITING
- XCOMMANDS). Note that multiple graphs may be drawn on the same page.
- X.TP
- X\fBgraph \|{\fIinteger\fB\|}\fR
- XThis edits the graph denoted by
- X\fB\|{\fIinteger\fB\|}. \fR
- XIf the graph doesn't exist, then this command creates it and starts
- Xediting it.
- X\fBNewgraph\fR
- Xis simply an abbreviation for
- X\fB\fIgraph\fB \fIn\fB\fR
- Xwhere n=0 if this is the first graph, otherwise n=m+1, where m is the
- Xlargest number of any graph so far.
- X.TP
- X\fBcopygraph \|[\fIinteger\fB\|]\fR
- XThis creates a new graph, and copies all the attributes from the
- Xgraph
- X\fB\|[\fIinteger\fB\|]'s\fR
- Xx and y axes, as well as its
- X\fB\fIx_translate\fB\fR
- Xand
- X\fB\fIy_translate\fB\fR
- Xvalues, the clipping, the legend defaults, and
- Xthe title defaults. If the
- X\fB\|[\fIinteger\fB\|]\fR
- Xis omitted, then it copies its values from the ``previous''
- Xgraph, which is
- Xdefined to be the graph with the largest number
- Xless than the currrent graph's number. If the current
- Xgraph has the smallest number, then it will take the last graph from
- Xthe previous page of graphs. If there is no previous page, then an
- Xerror will be flagged.
- X(copygraph does not copy the values of the
- X\fB\fIhash_at\fB, \fImhash_at\fB,\fR
- Xand
- X\fB\fI\fIhash_label\fB\fR
- Xattributes).
- X.TP
- X.B newpage
- XThis command is for plotting graphs on multiple pages. After a
- X\fBnewpage,\fR
- Xthe graphs that the user enters will be plotted on a new page.
- XNew graphs and strings will be numbered starting with 0.
- XEssentially,
- X\fB\fInewpage\fB\fR
- Xis the same as appending together the output of separate calls of
- Xjgraph on the text before the
- X\fB\fInewpage,\fB\fR
- Xand on the text after the
- X\fB\fInewpage.\fB\fR
- X\fB\fINewpage\fB\fR
- Xwill most likely produce bizarre results if the
- X\fB\-P\fR
- Xoption is not specified.
- X.TP
- X\fBX \|[\fIfloat\fB\|]\fR
- X.br
- X.ns
- X.TP
- X\fBY \|[\fIfloat\fB\|]\fR
- XPostscript files to be embedded in LaTeX (and some other programs)
- Xcontain a ``bounding box''
- Xwhich defines the area which LaTeX will allocate for the postscript.
- XOther programs use this bounding box as well, sometimes using it
- Xto define where to clip the postscript image.
- X\fBJgraph \fR
- Xuses the axis lines and labels, and the title to generate its
- Xbounding box. Most of the time that's good enough to work in
- XLaTeX. The
- X\fB\fIY\fB\fR
- Xand
- X\fB\fIX\fB\fR
- Xcommands say to make the height and width of the bounding box at least
- X\fB\fIY\fB\fR
- Xand
- X\fB\fIX\fB\fR
- Xinches, respectively, but to maintain the current centering of the
- Xgraph. If you still need further control over the
- Xbounding box (e.g. to change the centering), try the
- X\fB\fIbbox\fB\fR
- Xcommand. If there's more than one page in the jgraph file,
- X\fB\fIY,\fB\fR
- X\fB\fIX\fB\fR
- Xand
- X\fB\fIbbox\fB\fR
- Xvalues can be given for each graph.
- X.TP
- X\fBbbox \fIfloat\fB \fIfloat\fB \fIfloat\fB \fIfloat\fB\fR
- XIf the
- X\fB\fIY\fB\fR
- Xand
- X\fB\fIX\fB\fR
- Xcommands aren't enough to help you define a good bounding box, this
- Xcommand lets you explicitly enter one which will go directly into the
- Xjgraph output. Its units are the
- Xfinal postscript units. It's probably best to use the
- X\fB\-p\FR
- Xoption
- Xto see what the bounding box is that jgraph produces, and then
- Xalter that accordingly with
- X\fB\fIbbox.\fB\fR
- XThe main use for this is to change the automatic centering that jgraph
- Xperforms: Usually the center of the bounding box that jgraph computes
- Xis put at the center of the page. Changing the bbox changes this
- Xcenter.
- X.TP
- X\fBpreamble : \|{\fIstring\fB\|}\fR
- X.br
- X.ns
- X.TP
- X\fBpreamble {\fItoken\fB\|}\fR
- X.br
- X.ns
- X.TP
- X\fBepilogue : \|{\fIstring\fB\|}\fR
- X.br
- X.ns
- X.TP
- X\fBepilogue {\fItoken\fB\|}\fR
- XThese two commands allow the user to include strings or
- Xfiles (the token specifies the filename) which will be copied directly
- Xinto jgraph's output.
- XThe \fIpreamble\fB is included at the beginning of the output
- X(after some initial postscript to set things up for jgraph),
- Xand the \fIepilogue\fB is included at the end. A good use for
- Xthe \fIpreamble\fB is to set up a postscript dictionary if you're
- Xusing postscript marks.
- X.PD
- X.RE
- X.LP
- X.TP
- X.B GRAPH EDITING COMMANDS
- XThese commands act on the current graph.
- XGraph editing is terminated when one of the top-level description
- Xcommands is given.
- X.RS
- X.TP
- X\fBxaxis\fR
- X.br
- X.ns
- X.TP
- X\fByaxis\fR
- XEdit the x or y axis (see AXIS EDITING COMMANDS)
- X.TP
- X\fBnewcurve\fR
- XThis starts editing a new curve of the graph (see CURVE
- XEDITING COMMANDS).
- X.TP
- X\fBcurve \|{\fIinteger\fB\|}\fR
- XThis edits the curve denoted by
- X\fB\|{\fIinteger\fB\|}. \fR
- XIf the curve doesn't exist, then this command creates it and starts
- Xediting it.
- X\fINewcurve\fB
- Xand
- X\fIcurve\fB
- Xinteract as
- X\fInewgraph\fB
- Xand
- X\fIgraph\fB
- Xdo.
- X.TP
- X\fBnewline\fR
- XThis is an abbreviation for:
- X.PP
- X.nf
- X newcurve marktype none linetype solid
- X.fi
- X.PP
- X.TP
- X\fBcopycurve \|[\fIinteger\fB\|]\fR
- XThis starts editing a new curve of the graph, and copies all its
- Xvalues except for the points from curve
- X\fB\|[\fIinteger.\fB\|]\fR
- XIf the
- X\fB\|[\fIinteger\fB\|]\fR
- Xis omitted, then it copies its values from the
- Xlast curve in this graph. If this graph currently has
- Xno curves, then it searches backwards from the previous graph.
- X.TP
- X\fBtitle\fR
- XThis edits the title of the graph (see LABEL EDITING
- XCOMMANDS). The title is given a default location centered beneath
- Xthe graph, and a default font size of 12, however, as with all
- Xlabels, this can be changed.
- X.TP
- X\fBlegend\fR
- XThe edits the legend of the graph (see LEGEND EDITING
- XCOMMANDS). As a default, the graph will contain a legend
- Xif any of its curves have labels.
- X.TP
- X\fBnewstring\fR
- XThis edits a new text string (see LABEL EDITING
- XCOMMANDS). This is useful as it allows the user to plot text on the
- Xgraph as well as curves.
- X.TP
- X\fBstring \|{\fIinteger\fB\|}\fR
- X.br
- X.ns
- X.TP
- X\fBcopystring \|[\fIinteger\fB\|]\fR
- X\fIString\fB
- Xand
- X\fIcopystring\fB
- Xare to
- X\fInewstring\fB
- Xas
- X\fIcurve\fB
- Xand
- X\fIcopycurve\fB
- Xare to
- X\fInewcurve.\fB
- X.TP
- X\fBborder\fR
- X.br
- X.ns
- X.TP
- X\fBnoborder\fR
- X\fIBorder\fR\fB
- Xdraws a square border around the area defined by the axes.
- X\fINoborder\fB
- Xspecifies no border.
- X\fINoborder\fB
- Xis the default.
- X.TP
- X\fBclip\fR
- X.br
- X.ns
- X.TP
- X\fBnoclip\fR
- X\fIClip\fB
- Xspecifies that all curves in the graph will be clipped -- that is,
- Xno points outside of the of axes will be plotted. Clipping can also be
- Xspecified on a per-curve basis. The default is
- X\fInoclip.\fB
- X.TP
- X\fBinherit_axes\fR
- XThis is an old command which is kept for backward compatibility.
- X\fICopycurve.\fB
- Xis equivalent to:
- X.PP
- X.nf
- X newgraph inherit_axes
- X.fi
- X.PP
- X.TP
- X\fBx_translate \|[\fIfloat\fB\|]\fR
- X.br
- X.ns
- X.TP
- X\fBy_translate \|[\fIfloat\fB\|]\fR
- XBy default, the bottom left-hand corner of each graph is at point
- X(0,0) (final postscript units).
- X\fIX_translate\fB
- Xand
- X\fIY_translate\fB
- Xtranslate the bottom left-hand corner of the graph
- X\fB\|[\fIfloat\fB\|] \fR
- Xinches. The main use of this is to draw more than one graph on
- Xa page. Note that jgraph considers all the graphs drawn on the
- Xpage when it computes its bounding box for centering. Thus, if
- Xonly one graph is drawn, it will always be centered on the page,
- Xregardless of its
- X\fIX_translate\fB
- Xand
- X\fIY_translate\fB
- Xvalues. These values are used for relative placement of the graphs.
- X To change the centering of the graphs, use
- X\fIbbox.\fB
- X.TP
- X\fBX \|[\fIfloat\fB\|]\fR
- X.br
- X.ns
- X.TP
- X\fBY \|[\fIfloat\fB\|]\fR
- XThese are the same as
- X\fIX\fB
- Xand
- X\fIY\fB
- Xin the
- XTop-level commands, except that they let the user continue editing
- Xthe current graph.
- X.PD
- X.RE
- X.LP
- X.TP
- X.B SIMPLE AXIS EDITING COMMANDS
- XThese commands act on the current
- Xaxis as chosen by
- X\fIxaxis\fB
- Xor
- X\fIyaxis\fB
- X(see GRAPH EDITING COMMANDS).
- XAxis editing terminates when a graph or top-level command is given.
- XThere are more advanced axis editing commands given below which have
- Xto do with moving the hash marks, adding new hash marks and labels,
- Xetc. See ADVANCED AXIS EDITING COMMANDS.
- X.RS
- X.TP
- X\fBlinear\fR
- X.br
- X.ns
- X.TP
- X.B log
- XSet the axis to be linear or logarithmic. The
- Xdefault is linear. If the axis is set to be logarithmic, then values
- X<= 0.0 will be disallowed, as they are at negative infinity on the
- Xaxis.
- X.TP
- X\fBmin \|[\fIfloat\fB\|]\fR
- X.br
- X.ns
- X.TP
- X\fBmax \|[\fIfloat\fB\|]\fR
- XSet the minimum and maximum values of
- Xthis axis. Defaults depend on the points given. They can be seen by
- Xusing the
- X\fB\-p \fR
- Xoption. Unless stated, all units (for example point
- Xplotting, string plotting, etc.) will be in terms of the
- X\fImin\fB
- Xand
- X\fImax\fB
- Xvalues of the x and y axes.
- X.TP
- X\fBsize \|[\fIfloat\fB\|]\fR
- XSet the size of this axis in inches.
- X.TP
- X\fBlog_base \|[\fIfloat\fB\|]\fR
- XSet the base of the logarithmic axis. Default =
- X10. This is the value which determines which hash
- Xmarks and hash labels are automatically produced.
- X.TP
- X\fBhash \|[\fIfloat\fB\|]\fR
- XHash marks will be
- X\fB\|[\fIfloat\fB\|] \fR
- Xunits apart. Default = -1.
- XIf this value equals 0, then there will be no hash marks. If
- Xthis value is less than 0, then the hash marks will be automatically
- Xset by
- X\fBjgraph \fR
- X(see
- X\fB\-p \fR
- Xfor the value). By default, each hash mark
- Xwill be labeled with its value.
- X\fIHash\fB
- Xand
- X\fIshash\fB
- Xare ignored if
- Xthe axes are logarithmic.
- X.TP
- X\fBshash \|[\fIfloat\fB\|]\fR
- XMake sure there is a hash mark at the point
- X\fB\|[\fIfloat\fB\|] \fR
- Xalong the axis. The default is set by
- X\fBjgraph\fR
- Xif
- X\fBhash\fR
- X= -1.
- XIf
- X\fIhash\fB
- Xis set by the user,
- X\fIshash\fB
- Xis defaulted to the
- X\fImin\fB
- Xvalue of the axis.
- X.TP
- X\fBmhash \|[\fIinteger\fB\|]\fR
- XPut
- X\fB\|[\fIinteger\fB\|] \fR
- Xminor hash marks between the above
- Xhash marks. Default = -1. If this value equals 0, then there will
- Xbe no minor hash marks. If this value is negative, then the value
- Xwill be chosen by
- X\fBjgraph \fR
- X(see
- X\fB\-p\fR
- Xfor the value).
- X.TP
- X\fBprecision \|[\fIinteger\fB\|]\fR
- XMake the label have
- X\fB\|[\fIinteger\fB\|] \fR
- Xdigits after
- Xthe decimal point. Default = -1. If this value is negative, then
- X\fBjgraph \fR
- Xwill choose one.
- X.TP
- X\fBlabel\fR
- XEdit the label of this axis (see LABEL EDITING COMMANDS).
- XBy default, the label is in font ``Times-Bold'', and has a font size of
- X10. If the user doesn't change any of the plotting attributes of the
- Xlabel,
- X\fBjgraph \fR
- Xchooses an appropriate place for the axis label.
- X.TP
- X\fBdraw_at \|[\fIfloat\fB\|]\fR
- XDraw the axis line at this point on the other axis.
- XThe default is usually the other axis's
- X\fImin, \fB
- Xhowever if
- X\fIhash_scale \fB
- Xis positive (see
- X\fIhash_scale \fB
- Xunder ADVANCED AXIS EDITING), it will be
- Xthe other axis's
- X\fImax.\fB
- X.TP
- X\fBnodraw\fR
- XDo not draw the axis, the hash marks or any labels. This
- Xis useful for plotting points with no axes, and for overlaying graphs
- Xon top of one another with no clashes. This is equivalent to
- X\fIno_draw_axis,\fB
- X\fIno_draw_axis_label,\fB
- X\fIno_draw_hash_marks,\fB
- Xand
- X\fIno_draw_hash_labels.\fB
- X.TP
- X\fBdraw\fR
- XCancels the effect of
- X\fInodraw. \fB
- XDefault =
- X\fIdraw.\fB
- XThis is
- Xequivalent to
- X\fIdraw_axis,\fB
- X\fIdraw_axis_label,\fB
- X\fIdraw_hash_marks,\fB
- Xand
- X\fIdraw_hash_labels.\fB
- X.TP
- X\fBgrid_lines\fR
- X.br
- X.ns
- X.TP
- X\fBno_grid_lines\fR
- X\fIGrid_lines\fB
- Xspecifies to plot a grid line at each major hash
- Xmark on this axis. The default is
- X\fIno_grid_lines.\fB
- X.TP
- X\fBmgrid_lines\fR
- X.br
- X.ns
- X.TP
- X\fBno_mgrid_lines\fR
- X\fIMgrid_lines\fB
- Xspecifies to plot a grid line at each minor hash
- Xmark on this axis. The default is
- X\fIno_mgrid_lines.\fB
- X.PD
- X.RE
- X.LP
- X.TP
- X.B CURVE EDITING COMMANDS
- XThese commands act on the current curve as
- Xchosen by
- X\fInewcurve\fB
- Xor
- X\fIcurve\fB
- X(see GRAPH EDITING COMMANDS). Curve
- Xediting terminates when a graph or top-level command is given.
- X.RS
- X.TP
- X\fBpts \|[\|{\fIfloat\fB\|} \|{\fIfloat\fB\|}\|]*\fR
- XThis sets the points to plot in this
- Xcurve. The first
- X\fIfloat\fB
- Xis the x value, and the second
- X\fIfloat\fB
- Xis the y
- Xvalue of the point. Points are plotted in the order specified.
- XThis command stops reading points when a non-float is given.
- XThe user can specify this command multiple times within a curve --
- Xeach time, simply more points are added to the curve.
- X.TP
- X\fBx_epts \|[\|{\fIfloat\fB\|} \|{\fIfloat\fB\|} \|{\fIfloat\fB\|} \|{\fIfloat\fB\|}\|]*\fR
- X.br
- X.ns
- X.TP
- X\fBy_epts \|[\|{\fIfloat\fB\|} \|{\fIfloat\fB\|} \|{\fIfloat\fB\|} \|{\fIfloat\fB\|}\|]*\fR
- XThis allows the user to specify points and ``confidence values'' (otherwise
- Xknown as ``error bars''). The first two
- X\fIfloats\fB
- Xspecify the x and y values of
- Xthe point, as above. If
- X\fBx_epts\fR
- Xis specified, then the second two
- X\fIfloats\fB
- Xspecify range or confidence values
- Xfor the x value of the point.
- XError bars will be printed to each of these x values (using the
- Xoriginal point's y value)
- Xfrom the original point. Similarly,
- X\fIy_epts\fB
- Xspecifies range or confidence values for the y value of the point.
- X\fIpts\fB
- X\fIx_epts\fB
- Xand
- X\fIy_epts\fB
- Xcan all be intermixed.
- X.TP
- X\fBmarktype\fR
- XThis sets the kind of mark that is plotted for this curve. Valid
- Xmarks are: \fIcircle\fR, \fIbox\fR, \fIdiamond\fR, \fItriangle\fR,
- X\fIx\fR, \fIcross\fR, \fIellipse\fR, \fIxbar\fR, \fIybar\fR,
- X\fItext\fR, \fIpostscript\fR, \fInone\fR, and variants of
- X\fIgeneral\fR. Most of these are self-explanatory, except for the
- Xlast few:
- X \fIXbar\fR makes the curve into a bar graph with the bars going
- Xto the x axis. \fIYbar\fR has the bars going to the y axis.
- X \fIText\fR lets the user plot text instead of a mark. The text is
- Xeditted as a label (see LABEL EDITING COMMANDS) immediately following
- Xthe \fItext\fR command. The x and y fields of the label have special
- Xmeanings here: They define where the label is to be printed in relation
- Xto the curve points. For example, if they are both 0, the label will
- Xbe printed directly on the curve points. If x is 1.0 and y is -1.0, then
- Xthe label will be printed one unit to the right and one unit below the
- Xcurve points (units are units of the x and y axes).
- XDefault label values are 0 for x and y, and center justification.
- X \fIPostscript:\fR See the \fIpostscript\fB token below.
- X \fINone\fR means that no mark will be
- Xplotted (this is useful for drawing lines).
- X There are four types of \fIgeneral\fR marks, which work using the
- X\fIgmarks\fB command described below. The four marktypes are
- X\fIgeneral\fR, \fIgeneral_nf\fR, \fIgeneral_bez\fR, and
- X\fIgeneral_bez_nf\fR.
- X By default, a new mark is chosen for each curve.
- X.TP
- X\fBmarksize \|[\fIfloat\fB\|] \|[\fIfloat\fB\|]\fR
- XThis sets the size of the mark. The
- Xfirst
- X\fB\|[\fIfloat\fB\|] \fR
- Xis the width of the mark, and the second is the height.
- XUnits are those of the x and y axes respectively, unless that axis is
- Xlogarithmic, in which case the units are inches. Negative marksizes
- Xare allowed (e.g. a negative height will flip a \fItriangle\fR mark).
- XThe default mark size can be determined using the
- X\fB\-p\fR
- Xoption of
- X\fBjgraph\fR
- X.TP
- X\fBmrotate \|[\fIfloat\fB\|]\fR
- XThis allows the user to rotate the mark
- X\fB\|[\fIfloat\fB\|] \fR
- Xdegrees. Default is zero.
- X.TP
- X\fBgray \|[\fIfloat\fB\|]\fR
- X.br
- X.ns
- X.TP
- X\fBcolor \|[\fIfloat\fB \fIfloat\fB \fIfloat\fB\|]\fR
- XThese specify either the grayness of the curve or its color. Values
- Xfor
- X\fIgray\fR
- Xshould be from 0 (black) to 1 (white). Values for
- X\fIcolor\fR\fB
- Xshould also be from 0 to 1. They are RGB values, and thus define the
- Xamount of red, green and blue in the curve respectively. Specifying
- Xcolor nullifies the gray value, and vice versa. The default is
- X\fIgray 0\fB
- X.TP
- X\fBfill \|[\fIfloat\fB\|]\fR
- X.br
- X.ns
- X.TP
- X\fBcfill \|[\fIfloat\fB\| \|\fIfloat\fB\| \|\fIfloat\fB\|]\fR
- XThis sets the filling of marks which define an area
- Xto fill (e.g. \fIbox\fR, \fIcircle\fR, \fIxbar\fR).
- X\fIfill\fB
- Xdefines a gray value, and
- X\fIcfill\fB
- Xdefines a color value (see
- X\fIgray\fB
- Xand
- X\fIcolor\fB
- Xabove for a description of the units).
- XThe default is
- X\fIfill 0\fB
- X(black).
- X.TP
- X\fBpoly\fR
- X.br
- X.ns
- X.TP
- X\fBnopoly\fR
- X.br
- X.ns
- X.TP
- X\fBpfill \|[\fIfloat\fB\|]\fR
- X.br
- X.ns
- X.TP
- X\fBpcfill \|[\fIfloat\fB\| \|\fIfloat\fB\| \|\fIfloat\fB\|]\fR
- X\fIPoly\fB allows the user to make jgraph treat the curve as a
- Xclosed polygon (or in the case of a bezier, a closed bezier curve).
- X\fIpfill\fB and \fIpcfill\fB specify the filling of the polygon,
- Xand work like \fIfill\fB and \fIcfill\fB above. The default is
- X\fInopoly\fB.
- X.TP
- X\fBgmarks \|[\|{\fIfloat\fB\|} \|{\fIfloat\fB\|}\|]*\fR
- X\fIGmarks\fB
- Xis a way for the user to define custom marks. For each mark on
- X\fI(x,y),\fB
- XEach pair of
- X\fB\|{\fIfloat_x\fB\|}, \|{\fIfloat_y\fB\|}, \fR
- Xwill define a point on the mark (x +
- X\fB(\fIfloat_x\fB * \fImarksize_x\fB / 2), y + (\fIfloat_y\fB * \fImarksize_y\fB / 2)).\fR
- X Thus, for example, the
- X\fIbox\fR mark could be defined as
- X.PP
- X.nf
- X gmarks -1 -1 -1 1 1 1 1 -1
- X marktype general
- X.fi
- X.PP
- XThe marktypes \fIgeneral\fR, \fIgeneral_nf\fR, \fIgeneral_bez\fR,
- Xand \fIgeneral_bez_nf\fR, allow the gmarks points to define
- Xa closed polygon, a line, a closed bezier curve and a
- Xregular bezier curve respectively (the ``nf'' stands for
- X``non-filled'').
- X.TP
- X\fBpostscript : \|{\fIstring\fB\|}\fR
- X.br
- X.ns
- X.TP
- X\fBpostscript {\fItoken\fB\|}\fR
- XThis allows the user to enter direct postscript as a mark. It
- Xautomatically sets the marktype to \fIpostscript\fR. If a string is
- Xentered, then that string is used as the mark in the jgraph output.
- XIf a token is entered, then that token must stand for a filename, which
- Xwill be copied to the output once for every mark. The postscript will
- Xbe set up so that when the string or file is put to the output, (0, 0) of
- Xthe the axes is in the middle of the mark, it is rotated by
- X\fImrotate\fB degrees, and scaled by
- X(\fImarksize_x\fB / 2), \fImarksize_y\fB / 2).
- XThus, the \fIbox\fR mark could be defined as:
- X.PP
- X.nf
- X postscript : 1 setlinewidth -1 -1 moveto -1 1 lineto \\
- X 1 1 lineto 1 -1 lineto -1 -1 lineto stroke
- X.fi
- X.PP
- X.TP
- X\fBlarrows\fR
- X.br
- X.ns
- X.TP
- X\fBrarrows\fR
- X.br
- X.ns
- X.TP
- X\fBnolarrows\fR
- X.br
- X.ns
- X.TP
- X\fBnorarrows\fR
- X\fIRarrows\fB
- Xspecifies to draw an arrow at the end of every line
- Xsegment in the curve.
- X\fILarrows\fB
- Xspecifies to draw an arrow at the beginning of every line segment.
- XThe size of the arrows can be changed by using
- X\fIasize.\fB
- XThe default is
- X\fInolarrows\fB
- Xand
- X\fInorarrows\fB.
- X Arrows always go exactly to the point specified, with the exception
- Xof when the marktype is ``circle''. In this case, the arrow goes to
- Xthe edge of the circle.
- X.TP
- X\fBlarrow\fR
- X.br
- X.ns
- X.TP
- X\fBrarrow\fR
- X.br
- X.ns
- X.TP
- X\fBnolarrow\fR
- X.br
- X.ns
- X.TP
- X\fBnorarrow\fR
- XThis is analgous to the above, except that with \fIlarrow\fB, the
- Xonly arrow drawn is to the beginning of the first segment in the
- Xcurve, and with \fIrarrow\fB, the only arrow drawn is to the end
- Xof the last segment.
- X.TP
- X\fBasize \|[\fIfloat\fB\|] \|[\fIfloat\fB\|]\fR
- XThis sets the size of the arrows. The first
- X\fB\|[\fIfloat\fB\|] \fR
- Xcontrols the arrow's width. Its units are those of the x-axis.
- XThe second
- X\fB\|[\fIfloat\fB\|] \fR
- Xcontrols the arrow's height. It is in the units of the y-axis.
- XUse the -p option of jgraph to see the default values.
- X.TP
- X\fBafill \|[\fIfloat\fB\|]\fR
- X.br
- X.ns
- X.TP
- X\fBacfill \|[\fIfloat\fB\| \|\fIfloat\fB\| \|\fIfloat\fB\|]\fR
- XThese control the grayness or color of arrowheads.
- X\fIAfill\fB
- Xand
- X\fIacfill\fB
- Xwork in the same way as
- X\fIfill\fB
- Xand
- X\fIcfill\fB
- Xdescribed above. The default is
- X\fIafill 0\fB
- X(black).
- X.TP
- X\fBlinetype \|[\fItoken\fB\|]\fR
- XThis defines the type of the line connecting the points. Valid
- Xentries are \fIsolid\fR, \fIdotted\fR, \fIdashed\fR, \fIlongdash\fR,
- X\fIdotdash\fR, \fIdotdotdash\fR, \fIdotdotdashdash\fR, \fIgeneral\fR, and
- X\fInone\fR. The default is \fInone\fR. \fIGeneral\fR lets the user define
- Xhis own linetype using the
- X\fIglines\fB
- Xcommand described below. Points are connected in the
- Xorder in which they are inserted using the
- X\fIpts\fB
- Xcommand.
- X.TP
- X\fBglines \|[\fIfloat\fB\|]*\fR
- XThis lets the user specify the exact dashing of a line. The format
- Xis as in postscript -- the first number is the length of the first
- Xdash, the second is the length of the space after the first dash,
- Xetc. For example, \fIdotdash\fB could be defined as ``\fIglines\fB 5 3
- X1 3''.
- X.TP
- X\fBlinethickness \|[\fIfloat\fB\|]\fR
- XThis defines the line thickness (in
- Xabsolute postscript units) of the connecting line. Default = 1.0.
- X.TP
- X\fBbezier\fR
- X.br
- X.ns
- X.TP
- X\fBnobezier\fR
- X.br
- X.ns
- X\fIBezier\fB
- Xspecifies to use the curve's points to define successive bezier curves.
- XThe first point is the starting point. The next two are control points
- Xfor the bezier curve and the next point is the ending point. If there
- Xis another bezier, this ending point is also the beginning point of the
- Xnext curve. The next two points are again control points, and the next
- Xpoint is the ending point. Thus, a bezier must have a total of (3n + 1)
- Xpoints, where n is at least 1.
- X In bezier curves, marks and arrows only apply to every third point.
- X\fINobezier\fB is the default.
- X
- X.TP
- X\fBclip\fR
- XThis specifies that this curve will be clipped -- that is,
- Xno points outside of the of axes will be plotted.
- X.TP
- X\fBnoclip\fR
- XThis turns off clipping. If clipping was specified for the
- Xentire graph, then
- X\fInoclip\fB
- Xhas no effect.
- X\fINoclip\fB
- Xis the default.
- X.TP
- X\fBlabel\fR
- XThis edits the label of this curve for the purposed of
- Xdrawing a legend. (see LABEL EDITING COMMANDS and LEGEND EDITING
- XCOMMANDS). Unless the legend entry is
- X\fIcustom\fB,
- Xsetting any label attribute except for the text itself
- Xwill have no effect.
- X.PD
- X.RE
- X.LP
- X.TP
- X.B LABEL EDITING COMMANDS
- XThe following commands are used for editing
- Xlabels. Unless stated otherwise, the defaults are written with each
- Xcommand. Label editing terminates when one of these tokens is not
- Xgiven.
- X.RS
- X.TP
- X\fB: \|{\fIstring\fB\|}\fR
- XThis sets the string of the label. If no string is
- Xset, the label will not be printed.
- X.TP
- X\fBx \|[\fIfloat\fB\|]\fR
- X.br
- X.ns
- X.TP
- X\fBy \|[\fIfloat\fB\|]\fR
- XThis sets the x or y coordinate of the
- Xlabel. Units are the units of the x and y axes respectively.
- X.TP
- X\fBfont \|[\fItoken\fB\|]\fR
- XThis sets the font. Default is usually ``Times-Roman''.
- X.TP
- X\fBfontsize \|[\fIfloat\fB\|]\fR
- XThis sets the fontsize in points. Default is usually 9.
- X.TP
- X\fBlinesep \|[\fIfloat\fB\|]\fR
- XThis sets the distance between lines in multilined labels. Units are points.
- XThe default is the fontsize.
- X.TP
- X\fBhjl\fR
- X.br
- X.ns
- X.TP
- X\fBhjc\fR
- X.br
- X.ns
- X.TP
- X\fBhjr\fR
- XThese set the horizontal justification to left,
- Xcenter, and right, respectively. Default =
- X\fIhjc.\fB
- X.TP
- X\fBvjt\fR
- X.br
- X.ns
- X.TP
- X\fBvjc\fR
- X.br
- X.ns
- X.TP
- X\fBvjb\fR
- XThese set the vertical justification to top
- Xcenter, and bottom, respectively. Default =
- X\fIvjb.\fB
- X.TP
- X\fBrotate \|[\fIfloat\fB\|]\fR
- XThis will rotate the string
- X\fB\|[\fIfloat\fB\|] \fR
- Xdegrees. The point of rotation is defined by the
- X\fIvj\fB
- Xand
- X\fIhj\fB
- Xcommands. For example, to rotate 90 degrees about the center of a string,
- Xone would use
- X\fIvjc hjc rotate 90.\fB
- X.TP
- X\fBlgray \|[\fIfloat\fB\|]\fR
- X.br
- X.ns
- X.TP
- X\fBlcolor \|[\fIfloat\fB \fIfloat\fB \fIfloat\fB\|]\fR
- XThese control the color or the grayness of the label. It works just as
- X\fIgray\fB
- Xand
- X\fIcolor\fB
- Xdo for curves and axes. The default depends on the context. For example,
- Xfor strings and the title, the default is black. For axis labels and hash
- Xlabels, the default is the color of the axis. For text as marks, the
- Xdefault is the curve color.
- X.PD
- X.RE
- X.LP
- X.TP
- X.B LEGEND EDITING COMMANDS
- XThese commands allow the user to alter the
- Xappearance of the legend. Legends are printed out for each curve
- Xhaving a non-null label. The legend entries are printed out
- Xin the order of ascending curve numbers.
- XLegend editing terminates when a graph command or top level command
- Xis issued.
- X
- XIn earlier versions of jgraph (before version 8.0), the
- Xcharacteristics of each legend entry were set in the label portion
- Xof the entry's curve. Thus, for example, if you wanted each entry's
- Xfontsize to be 18, you had to set it in each entry's curve. Now,
- Xdefault legend entry characteristics are set using the
- X\fIdefaults\fB
- Xkeyword. Unless a
- X\fIcustom\fB
- Xlegend is specified, these default values override any values set in
- Xthe entry's curve. Thus, to get all entries to have a fontsize of
- X18, it must be set using
- X\fIdefaults fontsize 18.\fB
- X
- XIf legend editing seems cryptic, try the following example:
- X.PP
- X.nf
- X newgraph
- X newcurve marktype box linetype solid label : Solid box
- X pts 0 0 1 1 2 1 3 1
- X newcurve marktype circle linetype dotted label : Dotted circle
- X pts 0 1 1 2 2 2 3 2
- X newcurve marktype x linetype dashed label : Dashed x
- X pts 0 2 1 3 2 3 3 3
- X legend defaults
- X font Times-Italic fontsize 14 x 1.5 y 3.5 hjc vjb
- X.fi
- X.PP
- XThe legend of this graph should be centered over the top of the graph,
- Xand all legend entries should be 14pt Times-Italic.
- X.RS
- X.TP
- X\fBon\fR
- X.br
- X.ns
- X.TP
- X\fBoff\R
- XThese turn printing of the legend on and off. The default is on
- X(but, of course, if there are no curve labels defined, there will
- Xbe no legend).
- X.TP
- X\fBlinelength \|[\fIfloat\fB\|]\fR
- XThis sets the length of the line printed in
- Xfront of legend entries corresponding to curves which have lines.
- XUnits are those of the x axis, unless the x axis is logarithmic, in
- Xwhich case the units are inches. The default may be gotten using the
- X\fB\-p\fR
- Xoption.
- X.TP
- X\fBlinebreak \|[\fIfloat\fB\|]\fR
- XThis sets the vertical distance between
- Xindividual legend entries. Units are those of the y axis, unless the
- Xy axis is logarithmic, in which case the units are inches. The
- Xdefault may be gotten using the
- X\fB\-p\fR
- Xoption.
- X.TP
- X\fBmidspace \|[\fIfloat\fB\|]\fR
- XThis sets one of two things. If any of the
- Xlegend entries have lines in them, then this sets the distance
- Xbetween the end of the line and the legend entry text. Otherwise,
- Xthis sets the distance between center of the mark and the legend
- Xentry text. Units are those of the x axis, unless the x axis is
- Xlogarithmic, in which case the units are inches. The default may be
- Xgotten using the
- X\fB\-p\fR
- Xoption.
- X.TP
- X\fBdefaults\fR
- XThis lets the user change the attributes of all legend entries.
- XThe defaults are editted as a label (see LABEL EDITING COMMANDS).
- XA few of the label fields have special meanings: The \fI:\fR field
- Xis ignored. The \fIx\fR and \fIy\fR fields define where the label
- Xwill be printed. The \fIhj\fR and \fIvj\fR fields define the justification
- Xof the legend about the \fIx\fR and \fIy\fR point. Thus, if \fIx\fR is 10
- Xand \fIy\fR is 15, and \fIhjc vjb\fR are specified, then the legend will
- Xbe centered horizontally about x=10, and the bottom of the legend
- Xwill be placed on y=15. This is analagous to label plotting.
- XThe \fIrotate\fR field is also analagous to label plotting.
- X
- XDefaults are as follows. \fIRotate\fR is 0. \fIfont\fR is ``Times-Roman''
- Xand \fIfontsize\fR is 9. The color is black. Default justification is
- X\fIhjl\fR and \fIvjc\fR. The default \fIx\fR and \fIy\fR values are set
- Xaccording to the \fIhj\fR and \fIvj\fR fields. See the
- X\fB\-p\fR
- Xoption.
- X.TP
- X\fBleft\fR
- X.br
- X.ns
- X.TP
- X\fIright\fB
- XThese will automatically produce a legend to the left or
- Xthe right of the graph.
- X\fILeft\fB
- Xis equivalent to
- X\fIdefaults hjr vjc\fB
- Xand
- X\fIright\fB
- Xis equivalent to
- X\fIdefaults hjl vjc.\fB
- X.TP
- X\fBtop\fR
- X.br
- X.ns
- X.TP
- X\fBbottom\fR
- XThese will automatically produce a legend on the top or
- Xthe bottom of the graph.
- X\fITop\fB
- Xis equivalent to
- X\fIdefaults hjl vjb\fB
- X and
- X\fIbottom\fB
- Xis equivalent to
- X\fIdefaults hjl vjt.\fB
- X.TP
- X\fBx \|[\fIfloat\fB\|]\fR
- X.br
- X.ns
- X.TP
- X\fBy \|[\fIfloat\fB\|]\fR
- XThese are included mainly for backward compatability to earlier
- Xversions of jgraph. Setting
- X\fIx\fB
- Xand
- X\fIy\fB
- Xis equivalent to ``defaults x
- X\fIfloat\fB
- Xy
- X\fIfloat\fB
- Xhjl vjt''
- X.TP
- X\fBcustom\fR
- XThis lets the user control where each individual legend
- Xentry goes. The values of the
- X\fIdefaults\fB
- Xfields are ignored, and instead, the values of the curve's
- Xlabels are used. All justifications have defined results, except
- Xfor
- X\fIhjc\fB.
- XSimilarly, rotation other than 0 is likely to produce bad effects.
- X.PD
- X.RE
- X.LP
- X.TP
- X.B ADVANCED AXIS EDITING
- XThese are more advanced commands for
- Xediting an axis. This includes drawing explicit hash marks and
- Xlabels, moving the hash marks, axes, and labels, not drawing the hash
- Xmarks, labels, axes, etc.
- X.RS
- X.TP
- X\fBgray \|[\fIfloat\fB\|]\fR
- X.br
- X.ns
- X.TP
- X\fBcolor \|[\fIfloat\fB \fIfloat\fB \fIfloat\fB\|]\fR
- XThese specify either the grayness of the axis or its color. Values
- Xfor
- X\fIgray\fB
- Xshould be from 0 (black) to 1 (white). Values for
- X\fIcolor\fB
- Xshould also be from 0 to 1. They are RGB values, and thus define the
- Xamount of red, green and blue in the axis respectively. Specifying
- Xcolor nullifies the gray value, and vice versa. The default is
- X\fIgray 0\fB.
- XThese values affect every part of the axis: the label,
- Xthe hash marks and labels, the axis line and the grid lines.
- X.TP
- X\fBgrid_gray \|[\fIfloat\fB\|]\fR
- X.br
- X.ns
- X.TP
- X\fBgrid_color \|[\fIfloat\fB \fIfloat\fB \fIfloat\fB\|]\fR
- X.br
- X.ns
- X.TP
- X\fBmgrid_gray \|[\fIfloat\fB\|]\fR
- X.br
- X.ns
- X.TP
- X\fBmgrid_color \|[\fIfloat\fB \fIfloat\fB \fIfloat\fB\|]\fR
- XThese allow the user to define the grayness or color of the
- Xgridlines and the mgridlines to be different from those of the
- Xaxis lines.
- XThe default
- X\fIgrid_gray\fB
- Xand
- X\fIgrid_color\fB
- Xis the same as the axis's
- X\fIgray\fB
- Xand
- X\fIcolor\fB.
- XThe default
- X\fImgrid_gray\fB
- Xand
- X\fImgrid_color\fB
- Xis the same as
- X\fIgrid_gray\fB
- Xand
- X\fIgrid_color\fB.
- X.TP
- X\fBhash_at \|[\fIfloat\fB\|]\fR
- XDraw a hash mark at this point. No label is
- Xmade for this hash mark.
- X.TP
- X\fBmhash_at \|[\fIfloat\fB\|]\fR
- XDraw a minor hash mark at this point.
- X.TP
- X\fBhash_label\fR
- XEdit a hash label (see HASH LABEL EDITING COMMANDS).
- X.TP
- X\fBhash_labels\fR
- XEdit the default characteristics of the hash labels.
- XThis is so that the user can change the fontsize, justification,
- Xetc., of the hash labels. Editing
- X\fIhash_labels \fB
- Xis just like editing
- Xnormal labels (see LABEL EDITING COMMANDS), except that the
- X\fI:,\fB
- X\fIx,\fB
- Xand
- X\fIy\fB
- Xvalues are all ignored. Defaults for hash labels are as
- Xfollows: Fontsize=9, Font=``Times-Roman'', Justification is dependent
- Xon whether it is the x or y axis and whether
- X\fIhash_scale\fB
- Xis positive or negative.
- X.TP
- X\fBhash_scale \|[\fIfloat\fB\|]\fR
- XThis is to change the size and orientation of
- Xthe hash marks. Default = -1.0. Changing this to -2.0 will double
- Xthe length of the hash marks. Changing this to +1.0 will make the
- Xhash marks come above or to the right of the axis.
- X.TP
- X\fBdraw_hash_marks_at \|[\fIfloat\fB\|]\fR
- XBy default, the hash marks are drawn
- Xeither above or below the axis. This command changes where they are
- Xdrawn.
- X\fIHash_scale\fB
- Xstill determines whether they are drawn above or
- Xbelow this point, and their size.
- X.TP
- X\fBdraw_hash_labels_at \|[\fIfloat\fB\|]\fR
- XBy default, the hash labels are
- Xdrawn either above or below the hash marks (again, this is dependent
- Xon
- X\fIhash_scale\fB).
- XThis command changes where they are drawn.
- XJustification and fontsize, etc., can be changed with the
- X\fIhash_labels\fB
- Xcommand.
- X.TP
- X\fBauto_hash_marks\fR
- X.br
- X.ns
- X.TP
- X\fBno_auto_hash_marks\fR
- XThis toggles whether or
- Xnot
- X\fBjgraph \fR
- Xwill automatically create hash marks according to
- X\fIhash,\fB
- X\fImhash\fB
- Xand
- X\fIshash\fB
- X(or
- X\fIlog_base\fB
- Xand
- X\fImhash\fB
- Xfor logarithmic axes).
- XThe default is
- X\fIauto_hash_marks.\fB
- X.TP
- X\fBauto_hash_labels\fR
- X.br
- X.ns
- X.TP
- X\fBno_auto_hash_labels\fR
- XThis toggles whether or
- Xnot
- X\fBjgraph \fR
- Xwill automatically create hash labels for the
- X\fIauto_hash_marks\fB.
- XDefault =
- X\fIauto_hash_labels\fB.
- X.TP
- X\fBdraw_axis\fR
- X.br
- X.ns
- X.TP
- X\fBno_draw_axis\fR
- XThis toggles whether or not the axis
- Xline is drawn. Default =
- X\fIdraw_axis.\fB
- X.TP
- X\fBdraw_axis_label\fR
- X.br
- X.ns
- X.TP
- X\fBno_draw_axis_label\fR
- XThis toggles whether or
- Xnot the axis label (as editted by the
- X\fIlabel\fB
- Xcommand) is drawn.
- XDefault =
- X\fIdraw_axis_label.\fB
- X.TP
- X\fBdraw_hash_marks\fR
- X.br
- X.ns
- X.TP
- X\fBno_draw_hash_marks\fR
- XThis toggles whether or
- Xnot the hash marks (both automatic and those created with
- X\fIhash_at\fB
- Xand
- X\fImhash_at\fB)
- Xare drawn. Default =
- X\fIdraw_hash_marks.\fB
- X.TP
- X\fBdraw_hash_labels\fR
- X.br
- X.ns
- X.TP
- X\fBno_draw_hash_labels\fR
- XThis toggles whether or
- Xnot the hash labels are drawn. Default =
- X\fIdraw_hash_labels.\fB
- X.PD
- X.RE
- X.LP
- X.TP
- X.B HASH LABEL EDITING COMMANDS
- XHash labels are simply strings printed
- Xalong the appropriate axis. As a default, they are printed at the
- Xplace denoted by the most recent
- X\fIhash_at\fB
- Xor
- X\fImhash_at\fB
- Xfor this
- Xaxis, but this can be changed by the
- X\fIat\fB
- Xcommand. If there has been
- Xno
- X\fIhash_at\fB
- Xor
- X\fImhash_at,\fB
- Xthen an
- X\fIat\fB
- Xcommand must be given, or
- Xthere will be an error. Hash editing terminates when either one of
- Xthese commands is not given.
- X.RS
- X.TP
- X\fB: \|{\fIstring\fB\|}\fR
- XThis sets the string of the hash label (see
- X\fBStrings\fR
- Xabove under THE DESCRIPTION LANGUAGE).
- X.TP
- X\fBat \|[\fIfloat\fB\|]\fR
- XThis sets the location of the hash label along the
- Xcurrent axis.
- X.PD
- X.RE
- X.LP
- X.SH FUNCTION PLOTTING AND OTHER NON-INHERENT FEATURES
- XAlthough
- X\fBjgraph \fR
- Xdoesn't have any built-in functions for interpolation
- Xor function plotting, both can be effected in
- X\fBjgraph \fR
- Xwith a little outside help:
- X.TP
- X\fBFunction plotting\fR
- XWith the
- X\fIinclude\fB
- Xand
- X\fIshell\fB
- Xstatement, it's easy to
- Xcreate a file of points of a function with a c or awk program, and
- Xinclude it into a graph. See the section HINTS AND EXAMPLE GRAPHS
- Xfor an example of a sin graph produced in this manner.
- X.TP
- X\fBPoint interpolation\fR
- XPoint interpolation is essentially the same as
- Xfunction plotting, and therefore is left out of
- X\fBjgraph. \fR
- XMaybe in a future release.
- X.SH HINTS AND EXAMPLE GRAPHS
- X\fBJgraph \fR
- Xshould be able to draw any kind of scatter/line/bar graph that
- Xa user desires. To embellish the graph with extra text, axes, lines,
- Xetc., it is helpful to use
- X\fIcopygraph.\fB
- XThe following example graphs show a few examples of different features
- Xof jgraph. They should be in the directory JGRAPH_DIR.
- X.sp
- X- acc.jgr is a simple bar graph. Acc.tex is also included to show
- Xhow one can include the output of jgraph in a LaTeX file. To get
- Xthis to work, you might have to substitute the entire pathname of
- Xthe file acc.jps in the acc.tex file.
- X.sp
- X- g8.jgr is a simple graph with some plotted text.
- X- ebars.jgr is a simple graph with error bars.
- X- sin.jgr shows how a sin function can be plotted using a simple c
- Xprogram to produce the sin wave. Moreover, this file shows a use of
- X\fIcopygraph\fB
- Xto plot an extra x and y axis at the 0 point.
- X.sp
- X- sin1.jgr is a further extension of sin.jgr only with one x and y
- Xaxis at 0, but with the axis labels at the left and the bottom of the
- Xgraph.
- X.sp
- X- sin2.jgr is a different sin wave with a logarithmic x axis.
- X.sp
- X- sin3.jgr shows how a bizarre effect can be gotten by sorting the
- Xpoints in a different manner.
- X.sp
- X- gpaper.jgr shows how you can get jgraph to easily produce graph paper.
- X.sp
- X- g9n10.jgr contains two graphs with complicated legends. It
- Xcontains a description of how the legend was created.
- X.sp
- X- mab2.jgr is a graph created by Matt Blaze which shows how a
- Xcomplicated output graph can be quite concisely and simply stated.
- XIn this graph, the x axis is a time line. It shows usage of the
- X\fIhash_label\fB
- Xand
- X\fIhash_labels\fB
- Xcommands, as well as displaying how jgraph lets you extract data from
- Xoutput files with awk.
- X.sp
- X- hypercube.jgr shows an interesting use of jgraph
- Xfor picture-drawing.
- X.sp
- X- alb.jgr is another use of jgraph for picture drawing. This file
- Xwas created by an awk script which Adam Buchsbaum wrote to draw
- Xtrees and graphs.
- X.sp
- XTo view these graphs, use jgraph -P, and view the resulting output
- Xfile with
- X\fIgs,\fB
- Xor a similar postscript viewer.
- XTo make a hard copy of these graphs, pipe the output of jgraph
- X-P directly to
- X\fIlpr.\fB
- X
- X.SH USING JGRAPH TO DRAW PICTURES
- XAs hypercube.jgr and alb.jgr show, jgraph can be used as a postscript
- Xpreprocessor to make drawings. There are two advantages
- Xusing jgraph to draw pictures instead of using standard drawing tools like
- X\fIxfig\fB,
- X\fIfibtool\fB,
- Xor
- X\fIidraw\fB.
- XThe first is that with jgraph, you know exactly where strings, lines,
- Xboxes, etc, will end up, because you plot them explicitly. The second
- Xadvantage is that for iterative drawings, with lots of patters, you
- Xcan combine jgraph with awk or c or any other programming language
- Xto get complex output in a simple way. Most what-you-see-is-what-you-get
- X(WYSIWYG) drawing tools cannot do this.
- X
- XThe major disadvantage of using jgraph to draw pictures is that jgraph
- Xis not WYSIWYG. You have to set up axes and plot points, lines and
- Xstrings. It's all a matter of taste.
- X
- XIf you'd like to see some more complex pictures drawn with jgraph, as
- Xwell as some hints to make picture-drawing easier, send me email
- X(jsp@princeton.edu).
- X
- X.SH EMBEDDING THE OUTPUT IN LATEX
- XI haven't read the manuals, but the way I've been loading these files
- Xinto LaTeX has been as follows:
- X.PP
- X.nf
- X1. Toward the beginning of my LaTeX file, I've had ``\\input{psfig}''
- X2. Where I've wanted my file, I've put:
- X
- X \\begin{figure}
- X \\centerline{\\psfig{figure=<path-name>/<filename-of-jgraph-output>}}
- X \\end{figure}
- X
- X Some versions of dvips or dvi2ps work without the path-name. Others
- X require that the path-name be present.
- X
- X3. After running latex on the file, do
- X
- X lpr -d file.dvi
- X
- X4. If that doesn't work, try dvips-ing the file and printing the postscript.
- X
- X.fi
- X.PP
- X.SH BUGS
- XLogarithmic axes cannot contain points <= 0. If I have
- Xenough complaints to convince me that this is a bug, I'll try to fix it.
- X.sp
- XThere is no real way to make the axes such that they decrease from
- Xleft to right or low to high -- or at least not without writing your
- Xown hash labels.
- X.sp
- XThere may well be loads of other bugs. Send to jsp@princeton.edu.
- X.sp
- XThis is $Revision: 8.0 $.
- END_OF_FILE
- if test 44248 -ne `wc -c <'jgraph.1'`; then
- echo shar: \"'jgraph.1'\" unpacked with wrong size!
- fi
- # end of 'jgraph.1'
- fi
- if test -f 'mab2.times' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'mab2.times'\"
- else
- echo shar: Extracting \"'mab2.times'\" \(2567 characters\)
- sed "s/^X//" >'mab2.times' <<'END_OF_FILE'
- XThu 00:00 | 746 | 397 | 787
- XThu 02:00 | 625 | 85 | 1066
- XThu 04:00 | 844 | 170 | 903
- XThu 06:00 | 779 | 169 | 638
- XThu 08:00 | 1168 | 978 | 3219
- XThu 10:00 | 2269 | 1599 | 5515
- XThu 12:00 | 1983 | 1963 | 5478
- XThu 14:00 | 2822 | 2077 | 7526
- XThu 16:00 | 1926 | 1730 | 5588
- XThu 18:00 | 1256 | 904 | 2559
- XThu 20:00 | 1110 | 672 | 2728
- XThu 22:00 | 1699 | 1414 | 4502
- XFri 00:00 | 919 | 418 | 1714
- XFri 02:00 | 793 | 131 | 1778
- XFri 04:00 | 785 | 114 | 1419
- XFri 06:00 | 685 | 84 | 285
- XFri 08:00 | 1382 | 795 | 3309
- XFri 10:00 | 2186 | 1485 | 5984
- XFri 12:00 | 1425 | 1212 | 4021
- XFri 14:00 | 1831 | 1884 | 4378
- XFri 16:00 | 1736 | 1243 | 4205
- XFri 18:00 | 1231 | 506 | 2768
- XFri 20:00 | 915 | 273 | 1224
- XFri 22:00 | 987 | 456 | 1411
- XSat 00:00 | 668 | 138 | 540
- XSat 02:00 | 766 | 120 | 1342
- XSat 04:00 | 781 | 129 | 648
- XSat 06:00 | 725 | 90 | 431
- XSat 08:00 | 687 | 169 | 519
- XSat 10:00 | 768 | 268 | 1013
- XSat 12:00 | 1513 | 977 | 1965
- XSat 14:00 | 1294 | 584 | 2318
- XSat 16:00 | 1337 | 699 | 2491
- XSat 18:00 | 1191 | 479 | 1662
- XSat 20:00 | 1249 | 497 | 1470
- XSat 22:00 | 1056 | 538 | 1467
- XSun 00:00 | 808 | 413 | 627
- XSun 02:00 | 914 | 97 | 1331
- XSun 04:00 | 654 | 60 | 493
- XSun 06:00 | 657 | 51 | 453
- XSun 08:00 | 780 | 216 | 755
- XSun 10:00 | 945 | 429 | 1304
- XSun 12:00 | 698 | 261 | 884
- XSun 14:00 | 345 | 135 | 684
- XSun 16:00 | 1157 | 406 | 1836
- XSun 18:00 | 1231 | 782 | 1710
- XSun 20:00 | 1229 | 386 | 1844
- XSun 22:00 | 1270 | 301 | 1882
- XMon 00:00 | 864 | 442 | 1309
- XMon 02:00 | 783 | 668 | 1444
- XMon 04:00 | 887 | 173 | 895
- XMon 06:00 | 801 | 164 | 756
- XMon 08:00 | 1370 | 682 | 3020
- XMon 10:00 | 1839 | 1083 | 8333
- XMon 12:00 | 1980 | 1205 | 10969
- XMon 14:00 | 1810 | 1546 | 6967
- XMon 16:00 | 2110 | 1793 | 5441
- XMon 18:00 | 2397 | 1763 | 7879
- XMon 20:00 | 1426 | 573 | 2943
- XMon 22:00 | 983 | 467 | 1686
- XTue 00:00 | 701 | 172 | 665
- XTue 02:00 | 998 | 161 | 1765
- XTue 04:00 | 814 | 157 | 892
- XTue 06:00 | 537 | 55 | 354
- XTue 08:00 | 701 | 588 | 3944
- XTue 10:00 | 1248 | 1038 | 3637
- XTue 12:00 | 2089 | 1170 | 4042
- XTue 14:00 | 3054 | 1694 | 7062
- XTue 16:00 | 4524 | 1642 | 8415
- XTue 18:00 | 1380 | 1491 | 2491
- XTue 20:00 | 1845 | 1530 | 2655
- XTue 22:00 | 1504 | 1513 | 2460
- XWed 00:00 | 863 | 467 | 686
- XWed 02:00 | 3833 | 428 | 4074
- XWed 04:00 | 860 | 196 | 767
- XWed 06:00 | 850 | 164 | 1568
- XWed 08:00 | 1574 | 1421 | 3551
- XWed 10:00 | 2692 | 2135 | 6666
- XWed 12:00 | 2041 | 2033 | 4309
- XWed 14:00 | 1882 | 2069 | 4106
- XWed 16:00 | 2403 | 2359 | 4947
- XWed 18:00 | 1632 | 1420 | 2779
- XWed 20:00 | 1984 | 1888 | 3410
- XWed 22:00 | 936 | 640 | 950
- X
- END_OF_FILE
- if test 2567 -ne `wc -c <'mab2.times'`; then
- echo shar: \"'mab2.times'\" unpacked with wrong size!
- fi
- # end of 'mab2.times'
- fi
- echo shar: End of archive 1 \(of 7\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 7 archives.
- rm -f ark[1-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-