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