home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-21 | 80.5 KB | 2,307 lines |
- Newsgroups: comp.sources.misc
- From: woo@playfair.stanford.edu ("Alexander Woo")
- Subject: v40i016: gnuplot - interactive function plotting utility, Part04/33
- Message-ID: <1993Oct21.144306.1545@sparky.sterling.com>
- X-Md4-Signature: da497ef7bb76e44e555708b01088abe5
- Sender: kent@sparky.sterling.com (Kent Landfield)
- Organization: Sterling Software
- Date: Thu, 21 Oct 1993 14:43:06 GMT
- Approved: kent@sparky.sterling.com
-
- Submitted-by: woo@playfair.stanford.edu ("Alexander Woo")
- Posting-number: Volume 40, Issue 16
- Archive-name: gnuplot/part04
- Environment: UNIX, MS-DOS, VMS
- Supersedes: gnuplot3: Volume 24, Issue 23-48
-
- #! /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".
- # Contents: gnuplot/docs/gnuplot.doc.B gnuplot/os2/print.c
- # Wrapped by kent@sparky on Wed Oct 20 17:14:38 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 4 (of 33)."'
- if test -f 'gnuplot/docs/gnuplot.doc.B' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'gnuplot/docs/gnuplot.doc.B'\"
- else
- echo shar: Extracting \"'gnuplot/docs/gnuplot.doc.B'\" \(63916 characters\)
- sed "s/^X//" >'gnuplot/docs/gnuplot.doc.B' <<'END_OF_FILE'
- X choices: `lines`, `points`, `linespoints`, `dots`, `steps`,
- X `impulses`, `errorbars`, `boxes`, or `boxerrorbars`.
- X `show function style` shows the current default plotting style for
- X functions. `set function style linespoints` would actually change
- X the default plotting style. See also `plot`.
- X3 functions
- X?show functions
- X The `show functions` command lists all user-defined functions and
- X their definitions.
- X
- X Syntax:
- X show functions
- X3 grid
- X?set grid
- X?show grid
- X?grid
- X The optional `set grid` draws a grid at the tic marks with the axis
- X linetype.
- X
- X Syntax:
- X set grid
- X set nogrid
- X show grid
- X3 hidden3d
- X?set hidden3d
- X?show hidden3d
- X The `set hidden3d` command enables hidden line removal for explicit
- X surface plotting (see `splot`).
- X Hidden line removal may be used for both explicit functions and for
- X explicit data. It now works for parametric surfaces as well.
- X
- X When this flag is set both the surface hidden portion and possibly
- X its hidden contours (see `set contour`) as well as the hidden grid will be
- X removed. Labels and arrows are always visible and are unaffected by this
- X command.
- X
- X Each surface has its hidden parts removed with respect to itself and to
- X other surfaces, if more than one surface is plotted. This mode is
- X meaningful when surfaces are plotted using line style drawing only.
- X
- X Syntax:
- X set hidden3d
- X set nohidden3d
- X show hidden3d
- X3 isosamples
- X?set isosamples
- X?show isosamples
- X?isosamples
- X An isoline is a curve parametrized by one of the surface parameters
- X while the other surface parameter is fixed. Isolines are a simple
- X means to display a surface. By fixing the u parameter of surface
- X s(u,v), the iso-u lines of the form c(v) = s(u0,v) are produced, and
- X by fixing the v parameter, the iso-v lines of the form c(u) = s(u,v0)
- X are produced.
- X
- X The isoline density of surfaces may be changed by the `set isosamples`
- X command. By default, sampling is set to 10 isolines per u or v axis.
- X A higher sampling rate will produce more accurate plots, but will take
- X longer. This parameter has no effect on data file plotting.
- X
- X Syntax:
- X set isosamples <iso_1> {,<iso_2>}
- X show isosamples
- X
- X Each surface plot will have <iso_1> iso-u lines and <iso_2> iso-v lines.
- X If you only specify <iso_1>, <iso_2> will be set to the same value as
- X <iso_1>.
- X
- X When a surface plot is being done without the removal of hidden
- X lines, `set samples` also has an effect on the number of points being
- X evaluated. See `set samples`.
- X3 key
- X?set key
- X?show key
- X?key
- X The `set key` enables a key describing curves on a plot. By default
- X the key is placed in the upper right corner of the plot.
- X
- X Syntax:
- X set key
- X set key <x>,<y>{,<z>}
- X set nokey
- X show key
- X
- X The coordinates <x>, <y> (and <z> for `splot`s) specify the location
- X of the key on the plot. The key is drawn as a sequence of lines, with
- X one plot described on each line. On the right hand side of each line
- X is a representation that attempts to mimic the way the curve is
- X plotted. On the left side of each line is the text description,
- X obtained from the `plot` command. See `plot title` to change this
- X description. The lines are vertically arranged so an imaginary
- X straight line divides the left- and right-hand sides of the key. It is
- X the coordinates of this line that are specified with the `set key`
- X command. In a `plot`, only the x and y coordinates are used to specify
- X the line position. For a `splot`, x, y and z are all being used as a
- X 3-d location mapped using the same mapping as the plot itself to form
- X the required 2-d screen position of the imaginary line.
- X
- X Some or all of the key may be outside of the plot boundary, although
- X this may interfere with other labels and may cause an error on some
- X devices.
- X
- X Examples:
- X
- X This places the key at the default location:
- X set key
- X This disables the key:
- X set nokey
- X This places a key at coordinates 2,3.5,2
- X set key 2,3.5,2
- X3 label
- X?set label
- X?set nolabel
- X?show label
- X?label
- X?nolabel
- X Arbitrary labels can be placed on the plot using the `set label`
- X command. If the z coordinate is given on a `plot` it is ignored; if
- X it is missing on a `splot` it is assumed to be 0.
- X
- X Syntax:
- X
- X set label {<tag>} {"<label_text>"} {at <x>,<y>{,<z>}}
- X {<justification>}
- X set nolabel {<tag>}
- X show label
- X
- X
- X The text defaults to "", and the position to 0,0,0. The <x>, <y>, and
- X <z> values are in the graph's coordinate system. The tag is an
- X integer that is used to identify the label. If no <tag> is given, the
- X lowest unused tag value is assigned automatically. The tag can be used
- X to delete or change a specific label. To change any attribute of an
- X existing label, use the `set label` command with the appropriate tag,
- X and specify the parts of the label to be changed.
- X
- X By default, the text is placed flush left against the point x,y,z.
- X To adjust the way the label is positioned with respect to the point
- X x,y,z, add the parameter <justification>, which may be `left`, `right`
- X or `center`, indicating that the point is to be at the left, right or
- X center of the text. Labels outside the plotted boundaries are
- X permitted but may interfere with axes labels or other text.
- X
- X Examples:
- X
- X To set a label at (1,2) to "y=x" use:
- X set label "y=x" at 1,2
- X To set a label "y=x^2" with the right of the text at (2,3,4), and tag
- X the label number 3, use:
- X set label 3 "y=x^2" at 2,3,4 right
- X To change the preceding label to center justification, use:
- X set label 3 center
- X To delete label number 2 use:
- X set nolabel 2
- X To delete all labels use:
- X set nolabel
- X To show all labels (in tag order) use:
- X show label
- X
- X (The EEPIC, Imagen, LaTeX, and TPIC drivers allow \\ in a string to specify
- X a newline.)
- X3 logscale
- X?set logscale
- X?set nologscale
- X?show logscale
- X?logscale
- X?nologscale
- X Log scaling may be set on the x, y, and z axes.
- X
- X Syntax:
- X set logscale <axes> <base>
- X set nologscale <axes>
- X show logscale
- X
- X where <axes> may be any combinations of `x`, `y`, and `z`, in any
- X order, and where <base> is the base of the log scaling. If <base>
- X is not given, then 10 is assumed. If <axes> is not given then all
- X three axes are assumed. The command `set logscale` turns on log
- X scaling on the specified axes, while `set nologscale` turns off
- X log scaling.
- X
- X Examples:
- X
- X To enable log scaling in both x and z axes:
- X set logscale xz
- X To enable scaling log base 2 of the y axis:
- X set logscale y 2
- X To disable z axis log scaling:
- X set nologscale z
- X3 mapping
- X?set mapping
- X?show mapping
- X?mapping
- X
- X Syntax:
- X set mapping { cartesian | spherical | cylindrical }
- X
- X Data for `splot`s are usually in regular Euclidean space and are
- X provided in Cartesian coordinates. Such 3-d data require three
- X coordinates (x, y and z) or one coordinate (only z) in each line in
- X the data file. In order to be able to use spherical or cylindrical
- X coordinate systems, use the `set mapping` command. In both cases two
- X coordinates are expected in each line of the data. For a spherical
- X coordinate system, these are theta and phi (in units as specified by
- X `set angles`) and the mapping is:
- X
- X x = cos( theta ) * cos( phi )
- X y = sin( theta ) * cos( phi )
- X z = sin( phi )
- X
- X For a cylindrical coordinate system, the mapping uses two variables,
- X theta (in units as specified by `set angles`) and z:
- X
- X x = cos( theta )
- X y = sin( theta )
- X z = z
- X
- X Again, note that mapping will affect data file `splot`s only.
- X3 offsets
- X?set offsets
- X?show offsets
- X?offsets
- X The amount of the graph that the plot takes up may be controlled to
- X some extent with the `set offsets` command. This command takes four
- X offset arguments: <left>, <right>, <top> and <bottom>. By default,
- X each offset is 0. Each offset may be a constant or an expression. Left
- X and right offsets are given in units of the x axis, while top and
- X bottom offsets are given in units of the y axis. The plot of sin(x),
- X displayed with offsets of 0, 0, 2, 2 will take up 1/3 of the
- X displayed y axis. Offsets are particularly useful with polar
- X coordinates as a means of compensating for aspect ratio distortion.
- X Offsets are ignored in `splot`s.
- X
- X Syntax:
- X set offsets <left>, <right>, <top>, <bottom>
- X show offsets
- X3 output
- X?set output
- X?show output
- X?output
- X By default, plots are displayed to the standard output. The
- X `set output` command redirects the display to the specified file
- X or device.
- X
- X Syntax:
- X set output {"<filename>"}
- X show output
- X
- X The filename must be enclosed in quotes. If the filename is
- X omitted, output will be sent to the standard output.
- X
- X On machines with popen functions (UNIX), output can be piped
- X through a shell command if the first letter of the filename
- X is '|'. For instance,
- X
- X Syntax:
- X set output "|lpr -Plaser filename"
- X set output "|lp -dlaser filename"
- X
- X (On MSDOS machines, set output "prn" will direct the output
- X to the default printer.)
- X
- X3 parametric
- X?set parametric
- X?set noparametric
- X?show parametric
- X?parametric
- X?noparametric
- X The `set parametric` command changes the meaning of `plot` (`splot`)
- X from normal functions to parametric functions. The command
- X `set noparametric` changes the plotting style back to normal,
- X single-valued expression plotting.
- X
- X In 2-d plotting, a parametric function is determined by a pair
- X of parametric functions operating on a parameter. An example
- X of a 2-d parametric function would be plot sin(t),cos(t) (which
- X defines a circle).
- X
- X For 3-d plotting, the surface is described as x=f(u,v), y=g(u,v),
- X z=h(u,v). Therefore a triplet of functions are required. An example of
- X 3-d parametric function would be cos(u)*cos(v),cos(u)*sin(v),sin(u)
- X (which defines a sphere). It takes three parametric function
- X specifications in terms of the parametric dummy arguments to describe
- X a single graph.
- X
- X The total set of possible plots is a superset of the simple f(x)
- X style plots, since the two (three) functions can describe the
- X x and y (and z) values to be computed separately. In fact,
- X plots of the type t,f(t) (u,v,f(u,v)) are equivalent to those
- X produced with f(x) when the x values are computed using the
- X identity function as the first function.
- X
- X Note that the order the parametric functions are specified is
- X xfunction, yfunction (and zfunction) and that each operates over the
- X common parametric domain.
- X
- X Also, the `set parametric` function implies a new range of values.
- X Whereas the normal f(x) and f(x,y) style plotting assume an xrange
- X and yrange (and zrange), the parametric mode additionally specifies a
- X trange, urange, and vrange. These ranges may be set
- X directly with `set trange`, `set urange` and `set vrange`, or by
- X specifying the range on the `plot` or `splot` commands. Currently
- X the default range for these parametric variables is [-5:5].
- X Setting the ranges to something more meaningful is expected.
- X3 polar
- X?set polar
- X?set nopolar
- X?show polar
- X?polar
- X?nopolar
- X The `set polar` command changes the meaning of the plot from
- X rectangular coordinates to polar coordinates. In polar coordinates,
- X the dummy variable (x) is an angle. The range of this angle is changed
- X from whatever it was to [0:2*pi], or, if degree unit has been selected,
- X to [0:360] (see `set angles`).
- X
- X The command `set nopolar` changes the meaning of the plot back to the
- X default rectangular coordinate system. The range of x is changed from
- X whatever it was to [-10:10].
- X
- X The `set polar` command is not supported for `splot`s. See the
- X `set mapping` command for similar functionality for `splot`s.
- X
- X While in polar coordinates the meaning of an expression in x is really
- X r = f(x), where x is an angle of rotation. The xrange controls the
- X domain (the angle) of the function, and the yrange controls the range
- X (the radius). The plot is plotted in a rectangular box, and the x and
- X y axes are both in units of the radius. Thus, the yrange controls both
- X dimensions of the plot output. The tics and units are written along
- X the axes rather than at the left and bottom. These unit are offset by
- X <rmin> specified by the `rrange` (See `set rrange`). It is not
- X possible to specify different output dimensions in the x or y
- X directions. The yrange can be used to shift the plot diagonally to
- X display only the first or third quadrants.
- X
- X Syntax:
- X set polar
- X set nopolar
- X show polar
- X Example:
- X set polar
- X plot x*sin(x)
- X plot [-2*pi:2*pi] [-3:3] x*sin(x)
- X The first plot uses the default polar angular domain of 0 to 2*pi.
- X The radius (and the size of the plot) is scaled automatically. The
- X second plot expands the domain, and restricts the range of the radius
- X (and the size of the plot) to [-3:3].
- X3 rrange
- X?set rrange
- X?show rrange
- X?rrange
- X The `set rrange` command sets the radial range used to compute x and y
- X values when in polar mode. If not in polar mode (see `set polar`) then
- X this range is not used. Use of this command offsets the polar
- X singularity to the <rmin> value and shifts the units on the axes tic
- X marks. For instance, `set rrange [-40:40]` would set the origin to -40
- X and would plot values of radial values between -40 to 40. Thus, if
- X 360 degrees of data were plotted, then the plot would extend 80 units
- X in radially from the origin. To view the entire plot, a
- X `set yrange [-80:80]` command would create a square viewport with
- X a circular plot tangent at the axes. Because `xrange` is used
- X specify the angular extent, only a square viewport can be specified
- X by `yrange`. For instance, `set yrange [0:80]` would display the
- X first quadrant and `set yrange [-80:0]` would display the third
- X quadrant. Any square viewport of any size can be specified but it
- X is constrained to be centered on a 45 degree line.
- X
- X This range may also be specified on the `plot` command line when in
- X polar mode.
- X
- X Syntax:
- X set rrange [{<rmin> : <rmax>}]
- X
- X where <rmin> and <rmax> terms are constants or expressions.
- X
- X Both the <rmin> and <rmax> terms are optional. Anything omitted will
- X not be changed, so
- X set rrange [:10]
- X changes rmax to 10 without affecting rmin.
- X3 samples
- X?set samples
- X?show samples
- X?samples
- X The sampling rate of functions may be changed by the `set samples`
- X command. By default, sampling is set to 100 points. A higher sampling
- X rate will produce more accurate plots, but will take longer. This
- X parameter no longer has any effect on data-file plotting.
- X
- X Syntax:
- X set samples <samples_1> {,<samples_2>}
- X show samples
- X
- X When a 2-d plot is being done, only the value of <samples_1> is
- X relevant.
- X
- X When a surface plot is being done without the removal of hidden
- X lines, the value of samples specifies the number of samples that are
- X evaluated per iso line. Each iso-v line will have <sample_1> samples
- X and each iso-u line will have <sample_2> samples. If you only specify
- X <samples_1>, <samples_2> will be set to the same value as <samples_1>.
- X See also `set isosamples`.
- X3 size
- X?set size
- X?show size
- X?size
- X The `set size` command scales the displayed size of the plot. On some
- X terminals, changing the size of the plot will result in text being
- X misplaced. Increasing the size of the plot may produce strange
- X results. Decreasing is safer.
- X
- X Syntax:
- X
- X set size {<xscale>,<yscale>}
- X show size
- X
- X The <xscale> and <yscale> values are the scaling factors for the size.
- X The defaults (1,1) are selected if the scaling factors are omitted.
- X
- X Examples:
- X
- X To set the size to normal size use:
- X set size
- X To make the plot half size use:
- X set size 0.5,0.5
- X To make a landscape plot have a 1:1 aspect ratio in polar mode use:
- X set size 0.721,1.0
- X To show the size use:
- X show size
- X
- X For the LaTeX and Fig terminals the default size (scale factor 1,1)
- X is 5 inches wide by 3 inches high. The big Fig terminal (`bfig`) is 7
- X inches wide by 5 inches high. The postscript default is landscape mode
- X 10 inches wide and 7 inches high.
- X Note that the size of the plot includes the space used by the labels;
- X the plotting area itself is smaller.
- X3 style
- X?set style
- X?show style
- X?style
- X?lines
- X?points
- X?linespoints
- X?impulses
- X?dots
- X?steps
- X?errorbars
- X?boxes
- X?boxerrorbars
- X?bargraph
- X Plots may be displayed in one of eight styles: `lines`, `points`,
- X `linespoints`, `impulses`, `dots`, `steps`, `errorbars`, `boxes`, or
- X `boxerrorbars`. The `lines` style connects adjacent points with lines.
- X The `points` style displays a small symbol at each point.
- X The `linespoints` style does both `lines` and `points`.
- X The `impulses` style displays a vertical line from the x axis
- X (or from the grid base for `splot`) to each point. The `dots` style
- X plots a tiny dot at each point; this is useful for
- X scatter plots with many points.
- X
- X The `errorbars` style is only relevant to 2-d data file plotting. It
- X is treated like `points` for `splot`s and function `plot`s. For data
- X `plot`s, `errorbars` is like `points`, except that a vertical error
- X bar is also drawn: for each point (x,y), a line is drawn from
- X (x,ylow) to (x,yhigh). A tic mark is placed at the ends of the error
- X bar. The ylow and yhigh values are read from the data file's columns,
- X as specified with the `using` option to plot. See `plot errorbars` for
- X more information.
- X
- X The `boxes` style is only relevant to 2-d plotting. It draws
- X a box centred about the given x coordinate from the yaxis to the given
- X y coordinate. The width of the box is obtained in one of three
- X ways. If a data file has a fifth column, this will be used to set
- X the width of the box. Otherwise, if a width has been set using the
- X `set boxwidth` command, this will be used. Otherwise the width of each
- X box will be calculated automatically so that it touches the adjacent
- X boxes. Another style called `boxerrorbars` is also available and is
- X only relevant to 2-d data file plotting. This style is a combination
- X of the `boxes` and `errorbars` styles.
- X
- X The `steps` style is only relevant to 2-d plotting. This style
- X connects consecutive points with two line segments: the first
- X from (x1,y1) to (x2,y1) and the second from (x2,y1) to (x2,y2).
- X
- X Default styles are chosen with the `set function style` and
- X `set data style` commands. See `plot style` for information about
- X how to override the default plotting style for individual functions.
- X
- X Syntax:
- X set function style <style>
- X set data style <style>
- X show function style
- X show data style
- X
- X where <style> is `lines`, `points`, `linespoints`, `impulses`,
- X `dots`, `steps`, `errorbars`, `boxes`, or `boxerrorbars`.
- X3 surface
- X?set surface
- X?set nosurface
- X?show surface
- X?surface
- X `set surface` controls the display of surfaces. It is useful if
- X contours are to be displayed by themselves. Whenever `set nosurface`
- X is issued, no surface isolines/mesh will be drawn. See also
- X `set contour`.
- X
- X Syntax:
- X set surface
- X set nosurface
- X show surface
- X3 terminal
- X?set terminal
- X?show terminal
- X?terminal
- X GNUPLOT supports many different graphics devices. Use the
- X `set terminal` command to select the type of device for which
- X GNUPLOT will produce output.
- X
- X Syntax:
- X set terminal {<terminal-type>}
- X show terminal
- X
- X If <terminal-type> is omitted, GNUPLOT will list the available
- X terminal types. <terminal-type> may be abbreviated.
- X
- X Use `set output` to redirect this output to a file or device.
- X
- X Several terminals have additional options. For example, see `dumb`,
- X `iris4d`, `hpljii` or `postscript`.
- X4 aifm
- X?set terminal aifm
- X?aifm
- X Several options may be set in the Adobe Illustrator 3.0 driver.
- X
- X Syntax:
- X set terminal aifm {<color>}
- X {"<fontname>"} {<fontsize>}
- X
- X Selecting default sets all options to their default values.
- X <color> is either `color` or `monochrome`.
- X "<fontname>" is the name of a valid PostScript font.
- X <fontsize> is the size of the font in PostScript points, before
- X scaling by the `set size` command.
- X Defaults are `monochrome`, "Helvetica", and 14pt.
- X
- X Also, since AI does not really support multiple pages, multiple
- X graphs will be output directly on one another. However, each graph
- X will be grouped individually, making it easy to separate them inside
- X AI (just pick them up and move them).
- X
- X Examples:
- X
- X set term aifm
- X set term aifm 22
- X set size 0.7,1.4
- X set term aifm color "Times-Roman" 14
- X
- X4 atari ST
- X?set terminal atari
- X?atari
- X The `atari` terminal has an option to set the character size and the
- X screen colors. The driver expects a space separated list the char size
- X and maximal 16 3 digit hex numbers where each digit represents RED, GREEN
- X and BLUE (in that order). The range of 0-15 is scaled to whatever color
- X range the screen actually has. On a normal ST screen, odd and even
- X intensities are the same.
- X
- X Examples:
- X
- X set terminal atari 4 # (use small (6x6) font)
- X set terminal atari 6 0 # (set monochrome screen to white on black)
- X set terminal atari 13 0 fff f00 f0 f ff f0f ff0
- X # (set first eight colors to black, white, green, blue, cyan, \
- X purple, and yellow and use large font (8x16).)
- X
- X Additionally, if an environment variable GNUCOLORS exists, its
- X contents are interpreted as an options string, but an explicit terminal
- X option takes precedence.
- X
- X4 dumb
- X?set terminal dumb
- X?dumb
- X The dumb terminal driver has an optional size specification.
- X
- X Syntax:
- X set terminal dumb {<xsize> <ysize>}
- X
- X where <xsize> and <ysize> set the size of the dumb terminals. Default
- X is 79 by 24.
- X
- X Examples:
- X set term dumb
- X set term dumb 79 49 # VGA screen--why would anyone want to do that?
- X4 epson
- X?set terminal epson
- X?set terminal epson180
- X?set terminal epson60
- X?set terminal starc
- X?set terminal tandy60
- X?epson
- X
- X This set of drivers support Epson printers and derivatives. See also
- X the NEC driver. `epson` is a generic 9 wire printer with a resolution
- X of 512x384. `starc` is a Star Color printer with the same resolution.
- X `epson180` and `epson60` are 180 dpi and 60 dpi drivers for newer
- X 24 wire printers. This also includes bubble jet printers. Their
- X resolutions are 1260x1080 and 480x360, respectively. The `tandy60`
- X is identical to the `epson60` driver with one additional escape
- X sequence to start IBM mode. With all of these drivers, a binary
- X copy is required on a PC to print. Do not use `print`.
- X
- X copy file /b lpt1:
- X
- X
- X4 gpic
- X?set terminal gpic
- X?gpic
- X
- X This driver is only known to work the Free Software Foundation
- X gpic/groff package. Modification for the Document Workbench
- X pic/troff package would be appreciated. FSF gpic can also
- X produce TeX output.
- X
- X A simple graph can be formatted using
- X
- X groff -p -mpic -Tps file.pic > file.ps.
- X
- X The output from pic can be pipe-lined into eqn, so it is possible to put
- X complex functions in a graph with the set label and set {x/y}label commands.
- X For instance,
- X
- X set ylab '@space 0 int from 0 to x alpha ( t ) roman d t@'
- X
- X Will label the y-axis with a nice integral if formatted with the
- X command:
- X
- X gpic filename.pic | geqn -d@@ -Tps | groff -m[macro-package] -Tps
- X > filename.ps
- X
- X Figures made this way can be scaled to fit into a document. The pic
- X language is easy to understand, so the graphs can be edited by hand if
- X need be. All coordinates in the pic-file produced by gnuplot are given
- X as x+gnuplotx and y+gnuploty. By default x and y are given the value 0
- X If this line is removed with an editor in a number of files one can
- X put several graphs i one figure like this (default size is 5.0x3.0 inches)
- X
- X .PS 8.0
- X x=0;y=3
- X copy "figa.pic"
- X x=5;y=3
- X copy "figb.pic"
- X x=0;y=0
- X copy "figc.pic"
- X x=5;y=0
- X copy "figd.pic"
- X .PE
- X
- X This will produce an 8 inches wide figure with four graphs in two rows
- X on top of each other
- X
- X One can also achieve the same thing by the command
- X
- X set term pic x y
- X
- X For example, using
- X
- X .PS 6.0
- X copy "trig.pic"
- X .PE
- X
- X4 hpljii
- X?set terminal hpljii
- X?hpljii
- X The HP LaserJet II and HP DeskJet drivers have a single option.
- X
- X Syntax:
- X set terminal hpljii {<resolution>}
- X set terminal hpdj {<resolution>}
- X
- X where <resolution> is the resolution of the output in dots per inch.
- X It must be `75`, `100`, `150` or `300`. Note: there must be
- X enough memory available to rasterize at the higher resolutions.
- X
- X Example:
- X set terminal hpljii 150
- X
- X4 latex
- X?set terminal latex
- X?latex
- X The LaTeX and EMTeX driver allows one to specify a font type and a font
- X size for the labels around a gnuplot graph.
- X
- X Options are:
- X Fonts:
- X default (Roman 10 point)
- X courier
- X roman
- X
- X at any size you specify. (BEWARE METAFONT will not like odd sizes.)
- X eg.
- X gnuplot> set term latex courier 5
- X
- X Unless your driver is capable of building fonts at any size (e.g. dvips),
- X stick to the standard 10, 11 and 12 point size.
- X
- X4 iris4d
- X?set terminal iris4d
- X?iris4d
- X The iris4d driver can operate in two modes.
- X
- X Syntax:
- X set terminal iris4d {24}
- X
- X If the hardware supports only 8 bits, use the default
- X `set terminal iris4d`. If, however, the hardware supports 24 bits
- X (8 per red/green/blue), use `set terminal iris4d 24`.
- X
- X When using 24-bit mode, the colors can be directly specified via the
- X file .gnuplot_iris4d that is searched in the current directory and
- X then in the home directory specified by the HOME environment variable.
- X This file holds RGB values for the background, border, labels and nine
- X plotting colors, in that order. For example, here is a file containing
- X the default colors:
- X
- X 85 85 85 /* Back Ground */
- X 0 0 0 /* Boundary */
- X 170 0 170 /* Labeling */
- X 85 255 255 /* Plot Color 1 */
- X 170 0 0 /* Plot Color 2 */
- X 0 170 0 /* Plot Color 3 */
- X 255 85 255 /* Plot Color 4 */
- X 255 255 85 /* Plot Color 5 */
- X 255 85 85 /* Plot Color 6 */
- X 85 255 85 /* Plot Color 7 */
- X 0 170 170 /* Plot Color 8 */
- X 170 170 0 /* Plot Color 9 */
- X
- X This file has exactly 12 lines of RGB triples. No empty lines are
- X allowed and anything after the third number in line is ignored.
- X
- X4 mf
- X?set terminal mf
- X?mf
- X?metafont
- X The mf terminal driver creates a input file to the MetaFont program.
- X Thus a figure may be used in the TeX document in the same way as a
- X character is.
- X
- X To use the plot in a document the MetaFont program must be run
- X with the output file from GnuPlot as input. Thus, the user needs a basic
- X knowledge of the font creating process and inclusion of a new font in a
- X document. However, if the Metafont program is set up properly at the
- X local site an unexperienced user could perform the operation without
- X much trouble.
- X
- X The text support is based on a MetaFont character set.
- X Currently the Computer Modern Roman font set is input but the
- X user are in principal free to chose whatever fonts he/she needs.
- X The MetaFont source files for the chosen font must be available.
- X Each character is stored in a separate picture variable in MetaFont. These
- X variables may be manipulated (rotated, scaled etc.) when characters are
- X needed. The drawback is the interpretation time in the MetaFont
- X program. On some machines (i.e. PC) the limited amount of memory available
- X may also cause problem if too many pictures are stored.
- X
- X5 Metafont Instructions
- X?set terminal mf detailed
- X?mf detailed
- X?metafont detailed
- X
- X - Set your terminal to metafont:
- X set terminal mf
- X - Select an output-file, e.g.:
- X set output "myfigures.mf"
- X - Do your plots. Each plot will generate a separate character. Its default
- X size will be 5*3 inches. You can change the size by saying set size 0.5,0.5
- X or whatever fraction of the default size you want to have.
- X
- X - Quit gnuplot.
- X
- X - Generate a tfm- and gf-file by running metafont on the output of gnuplot.
- X Since the plot is quite large (5*3 in), you will have to use a version
- X of metafont that has a value of at least 150000 for memmax. On Unix-systems
- X these are conventionally installed under the name bigmf. For the following
- X assume that the command virmf stands for a big version of metafont. For example:
- X
- X - Invoke metafont:
- X virmf '&plain'
- X - Select the output device: At the metafont prompt ('*') type:
- X \mode:=CanonCX; % or whatever printer you use
- X - Optionally select a magnification:
- X mag:=1; % or whatever you wish
- X - Input the gnuplot-file:
- X input myfigures.mf
- X On a typical Unix machine there will usually be a script called mf that
- X executes virmf '&plain', so you probably can substitute mf for virmf &plain.
- X This will generate two files: mfput.tfm and mfput.$$$gf (where $$$ indicates
- X the resolution of your device). The above can be conveniently achieved by
- X typing everything on the command line, e.g.:
- X virmf '&plain' '\mode:=CanonCX; mag:=1; input myfigures.mf'
- X In this case the output files will be named myfigures.tfm and
- X myfigures.300gf.
- X
- X - Generate a pk-file from the gf-file using gftopk:
- X gftopk myfigures.300gf myfigures.300pk
- X The name of the output-file for gftopk depends on the dvi-driver you use.
- X Ask your local TeX-administrator about the naming conventions.
- X Next, either install the tfm- and pk-files in the appropriate directories,
- X or set your environment-variables properly. Usually this involves setting
- X TEXFONTS to include the current directory and do the same thing for the
- X environment-variable that your dvi-driver uses (no standard name here...).
- X This step is necessary so that TeX will find the font-metric file and your
- X dvi-driver will find the pk-file.
- X
- X - To include your plots in your document you have to tell TeX the font:
- X \font\gnufigs=myfigures
- X Each plot you made is stored in a single character. The first plot is
- X character 0, the second is character 1, and so on... After doing the above
- X step you can use the plots just like any other characters. Therefore, to
- X place plots 1 and 2 centered in your document, all you have to do is:
- X \centerline{\gnufigs\char0}
- X \centerline{\gnufigs\char1}
- X in plain TeX. For LaTeX you can, of course, use the picture environment
- X and place the plot according to your wishes using the \makebox and \put
- X macros.
- X
- X It saves you a lot of time, once you have generated the
- X font, since TeX handles the plots as characters and uses minimal time to
- X place them. Also the documents you make change more often, than the plots
- X do. Also it saves a lot of TeX-memory. One last advantage of
- X using the metafont-driver is that the dvi-file really remains device
- X independent, because no \special-commands are used as in the eepic- and
- X tpic-drivers.
- X4 mif
- X?set terminal mif
- X?mif
- X Several options may be set in the MIF 3.00 driver.
- X
- X Syntax:
- X set terminal mif {<pentype>} {<curvetype>} {<help>}
- X
- X <pentype> selects "colour" of the graphics.
- X `colour` plot lines with line types >= 0 in colour (MIF sep. 2-7).
- X `monochrome` plot all line types in black (MIF sep. 0).
- X <curvetype> selects how "curves" are plotted.
- X `polyline` plot curves as continuous curves.
- X `vectors` plot curves as collections of vectors
- X <help> print online help on standard error output.
- X `help` print a short description of the usage, and the options
- X `?` print a short description of the usage
- X
- X This terminal driver produces Frame Maker MIF format version 3.00. It
- X plots in MIF Frames with the size 15*10 [cm], and plot primitives with
- X the same pen will be grouped in the same MIF group. Plot primitives in
- X a gnuplot plot will be plotted in a MIF Frame, and several MIF Frames
- X are collected in one large MIF Frame.
- X Plot primitives with line types >= 0 will as default be drawn in colour.
- X As default curves are plotted as continuous lines. The MIF font used for
- X text is "Times".
- X
- X Examples:
- X
- X set term mif
- X set term mif vectors
- X set term mif help
- X
- X
- X4 nec-cp6
- X?set terminal nec-cp6
- X?nec-cp6
- X One option may be set in the nec-cp6 driver. The resolution of this
- X driver is 400x320.
- X
- X Syntax:
- X set terminal nec-cp6 monochrome
- X set terminal nec-cp6 color
- X set terminal nec-cp6 draft
- X
- X4 pbm
- X?set terminal pbm
- X?pbm
- X Several options may be set in the PBMplus driver.
- X
- X Syntax:
- X set terminal pbm {<fontsize>} {<colormode>}
- X
- X where <fontsize> is `small`, `medium`, or `large` and <colormode> is
- X `monochrome`, `gray` or `color`.
- X Default size is 640 pixels wide and 480 pixels high.
- X The output for `monochrome` is a portable bitmap (one bit per pixel).
- X The output for `gray` is a portable graymap (three bits per pixel).
- X The output for `color` is a portable pixmap (color, four bits per pixel).
- X The output of these drivers can be used with Jef Poskanzer's
- X excellent PBMPLUS package which provides programs to convert
- X the above PBMPLUS formats to GIF, TIFF, MacPaint, Macintosh PICT,
- X PCX, X11 bitmap and many others.
- X
- X Examples:
- X
- X set term pbm small
- X set size 2,2
- X set term pbm color medium
- X
- X4 pcl5
- X?set terminal pcl5
- X?pcl5
- X Three options may be set in the pcl5 driver. The driver
- X actually uses HPGL-2 but there is a name conflict among
- X the terminal devices.
- X
- X Syntax:
- X set terminal pcl5 {<mode>} {<font>} {<fontsize>}
- X
- X where <mode> is `landscape`, or `portrait`, <font> is `stick`,
- X `univers`, or `cg_times`, and fontsize is the size in points.
- X set terminal pcl5 landscape
- X
- X4 postscript
- X?set terminal postscript
- X?postscript
- X Several options may be set in the PostScript driver.
- X
- X Syntax:
- X set terminal postscript {<mode>} {<color>} {<dashed>}
- X {"<fontname>"} {<fontsize>}
- X
- X where <mode> is `landscape`, `portrait`, `eps` or `default`.
- X Selecting default sets all options to their defaults.
- X <color> is either `color` or `monochrome`.
- X <dashed> is either `solid` or `dashed`.
- X "<fontname>" is the name of a valid PostScript font.
- X <fontsize> is the size of the font in PostScript points.
- X Defaults are `landscape`, `monochrome`, `dashed`, "Helvetica", and 14pt.
- X Default size of PostScript plot is landscape mode 10 inches wide
- X and 7 inches high.
- X
- X To get EPS output, use the `eps` mode and make only one plot per file.
- X In `eps` mode the whole plot is halved in size; the fonts are half the
- X given size, and the plot is 5 inches wide and 3.5 inches high.
- X
- X Examples:
- X
- X set term postscript default # old postscript
- X set term postscript landscape 22 # old psbig
- X set term postscript eps 14 # old epsf1
- X set term postscript eps 22 # old epsf2
- X set size 0.7,1.4
- X set term post portrait color "Times-Roman" 14
- X
- X4 regis
- X?set terminal regis
- X?table
- X The `regis` terminal device has the option of using 4 or 16
- X colors. The default is 4. For example:
- X set term regis 16
- X
- X4 table
- X?set terminal table
- X?table
- X Instead of producing a picture, term type `table` prints out
- X the evaluation results in a multicolumn ASCII table of X Y Z values.
- X For those times when you really want to see the numbers, now you
- X can see them on the screen or save to a file.
- X
- X4 windows
- X?set terminal windows
- X?windows
- X Three options may be set in the windows driver.
- X
- X Syntax:
- X set terminal windows {<color>} {"<fontname>"} {<fontsize>}
- X
- X `<color>` is either `color` or `monochrome`.
- X `"<fontname>"` is the name of a valid Windows font.
- X `<fontsize>` is the size of the font in points.
- X
- X5 graph-menu
- X?set terminal windows graph-menu
- X?graph-menu
- X The `gnuplot graph` window has the following options on a pop up menu
- X accessed by pressing the right mouse button or selecting `Options`
- X from the system menu:
- X
- X `Bring to Top` when checked brings the graph window to
- X the top after every plot.
- X
- X `Color` when checked enables color linestyles.
- X When unchecked it forces monochrome linestyles.
- X
- X `Copy to Clipboard` copies a bitmap and a Metafile picture.
- X
- X `Background...` sets the window background color.
- X
- X `Choose Font...` selects the font used in the graphics window.
- X
- X `Line Styles...` allows customization of the line colors
- X and styles.
- X
- X `Print...` prints the graphics windows using a Windows printer
- X driver and allows selection of the printer and scaling of the output.
- X The output produced by `Print` is not as good as that from gnuplot's
- X own printer drivers.
- X
- X `Update wgnuplot.ini` saves the current window locations, window
- X sizes, text window font, text window font size, graph window font,
- X graph window font size, background color and linestyles to the
- X initialisation file `WGNUPLOT.INI`.
- X
- X5 printing
- X?set terminal windows printing
- X?printing
- X In order of preference, graphs may be be printed in the
- X following ways.
- X
- X `1.` Use the gnuplot command `set terminal` to select a printer
- X and `set output` to redirect output to a file.
- X
- X `2.` Select the `Print...` command from the `gnuplot graph` window.
- X An extra command `screendump` does this from the text window.
- X
- X `3.` If `set output "PRN"` is used, output will go to a temporary file.
- X When you exit from gnuplot or when you change the output with another
- X `set output` command, a dialog box will appear for you to select
- X a printer port. If you choose OK, the output will be printed
- X on the selected port, passing unmodified through the print
- X manager. It is possible to accidently (or deliberately) send
- X printer output meant for one printer to an incompatible printer.
- X
- X5 text-menu
- X?set terminal windows text-menu
- X?text-menu
- X The `gnuplot text` window has the following options on a pop up menu
- X accessed by pressing the right mouse button or selecting `Options`
- X from the system menu:
- X
- X `Copy to Clipboard` copies marked text to the clipboard.
- X
- X `Paste` copies text from the clipboard as if typed by the user.
- X
- X `Choose Font...` selects the font used in the text window.
- X
- X `System Colors` when selected makes the text window honor the
- X System Colors set using the Control Panel. When unselected,
- X text is black or blue on a white background.
- X
- X `Update wgnuplot.ini` saves the current text window location, text
- X window size, text window font and text window font size to the
- X initialisation file `WGNUPLOT.INI`.
- X
- X `MENU BAR`
- X
- X If the menu file `WGNUPLOT.MNU` is found in the same directory as
- X WGNUPLOT.EXE, then the menu specified in `WGNUPLOT.MNU` will
- X be loaded.
- X
- X Menu commands are:
- X [Menu] Start a new menu with the name on the following line
- X [EndMenu] End current menu.
- X -- Insert a horizontal menu separator
- X | Insert a vertical menu separator
- X [Button] Put next macro on a push button instead of a menu.
- X
- X Macros take two lines with the macro name (menu entry) on the first
- X line and the macro on the second line. Leading spaces are ignored.
- X
- X Macros commands are:
- X [INPUT] Input string with prompt terminated by [EOS] or {ENTER}
- X [EOS] End Of String terminator. Generates no output.
- X [OPEN] Get name of file to open from list box, with title of
- X list box terminated by [EOS], followed by default
- X filename terminated by [EOS] or {ENTER}
- X This uses COMMDLG.DLL from Windows 3.1.
- X [SAVE] Get name of file to save. Similar to [OPEN]
- X
- X Macros character substitutions are:
- X {ENTER} Carriage Return '\r'
- X {TAB} Tab '\011'
- X {ESC} Escape '\033'
- X {^A} '\001'
- X ...
- X {^_} '\031'
- X
- X Macros are limited to 256 characters after expansion.
- X
- X5 wgnuplot.ini
- X?set terminal windows wgnuplot.ini
- X?wgnuplot.ini
- X Windows gnuplot will read some of its options from the `[WGNUPLOT]` section
- X of `WGNUPLOT.INI` in the Windows directory.
- X An example `WGNUPLOT.INI` file is shown below.
- X [WGNUPLOT]
- X TextOrigin=0 0
- X TextSize=640 150
- X TextFont=Terminal,9
- X GraphOrigin=0 150
- X GraphSize=640 330
- X GraphFont=Arial,10
- X GraphColor=1
- X GraphToTop=1
- X GraphBackground=255 255 255
- X Border=0 0 0 0 0
- X Axis=192 192 192 2 2
- X Line1=0 0 255 0 0
- X Line2=0 255 0 0 1
- X Line3=255 0 0 0 2
- X Line4=255 0 255 0 3
- X Line5=0 0 128 0 4
- X The `GraphFont` entry specifies the font name and size in points.
- X The 5 numbers given in the `Border`, `Axis` and `Line` entries are
- X the `Red` intensity (0-255), `Green` intensity, `Blue` intensity,
- X `Color Linestyle` and `Mono Linestyle`.
- X `Linestyles` are 0=SOLID, 1=DASH, 2=DOT, 3=DASHDOT, 4=DASHDOTDOT.
- X In the example `WGNUPLOT.INI` file above, Line 2 is a green solid
- X line in color mode, or a dashed line in monochrome mode.
- X The default line width is 1 pixel. If `Linestyle` is negative it
- X specifies the width of a SOLID line in pixels.
- X Line1 and any linestyle used with the `points` style must be
- X SOLID with unit width.
- X
- X5 windows3.0
- X?set terminal windows windows3.0
- X?windows3.0
- X Windows 3.1 is preferred, but WGNUPLOT will run under Windows 3.0
- X with the following restrictions:
- X
- X `1.` COMMDLG.DLL and SHELL.DLL (available with Windows 3.1 or Borland C++ 3.1)
- X must be in the windows directory.
- X
- X `2.` WGNUPLOT.HLP produced by Borland C++ 3.1 is in Windows 3.1 format.
- X You need to use the WINHELP.EXE supplied with Borland C++ 3.1.
- X
- X `3.` It won't run in real mode due to lack of memory.
- X
- X `4.` Truetype fonts are not available in the graph window.
- X
- X `5.` Drag-drop does not work.
- X
- X3 tics
- X?set tics
- X?show tics
- X?tics
- X By default, tics are drawn inwards from the border on all four sides.
- X The `set tics` command can be used to change the tics to be
- X drawn outwards on the left and bottom borders only.
- X This is useful when doing impulse plots.
- X
- X Syntax:
- X set tics {<direction>}
- X show tics
- X
- X where <direction> may be `in` or `out`. `set tics` defaults to `in`.
- X
- X See also the `set xtics`, `set ytics`, and `set ztics` command for more
- X control of tic marks.
- X?set ticslevel
- X?show ticslevel
- X?ticslevel
- X Using splot, in 3-d plots, one can adjust the relative height of the
- X vertical (Z) axis using `set ticslevel`. The numeric argument provided
- X specifies the location of the bottom of the scale. a zero will put it
- X on the bottom grid and any positive number somewhere along the z axis.
- X
- X Syntax:
- X set ticslevel {<level>}
- X show tics
- X
- X where <level> is a non negative numeric argument. For example,
- X
- X set ticslevel 0.5
- X
- X sets the tics level to the default value.
- X
- X See also the `set view`.
- X3 time
- X?set time
- X?show time
- X?time
- X The optional `set time` places the time and date of the plot either
- X at the top or bottom of the left margin. The exact location is
- X device dependent.
- X
- X Syntax:
- X set time {<xoff>}{,<yoff>}
- X set notime
- X show time
- X
- X Specifying constants <xoff> or <yoff> as optional offsets for the time
- X will move the time <xoff> or <yoff> character screen coordinates. For
- X example,
- X
- X set time ,-3
- X
- X will change only the y offset of the time, moving the title down by
- X roughly the height of three characters.
- X
- X3 title
- X?set title
- X?show title
- X?title
- X The `set title` command produces a plot title that is centered at the
- X top of the plot. Using the optional x,y screen offsets, the title
- X can be placed anywhere on the plot. `set title` with no parameters
- X clears the title.
- X
- X Syntax:
- X set title {"<title-text>"} {<xoff>}{,<yoff>}
- X show title
- X
- X Specifying constants <xoff> or <yoff> as optional offsets for the
- X title will move the title <xoff> or <yoff> character screen
- X coordinates. Note these are screen coordinates and not plot
- X coordinates. For example,
- X
- X set title ,-1
- X
- X will change only the y offset of the title, moving the title down by
- X roughly the height of one character.
- X
- X (The EEPIC, Imagen, LaTeX, and TPIC drivers allow \\ in a string to specify
- X a newline.)
- X3 trange
- X?set trange
- X?show trange
- X?trange
- X The `set trange` command sets the parametric range used to compute
- X x and y values when in parametric mode. If not in parametric mode
- X (see `set parametric`) then this range is not used. This command
- X does not affect x/y autoscaling or x/y ranges.
- X
- X This range may also be specified on the `plot` command line when
- X in parametric mode.
- X
- X Syntax:
- X set trange [{<tmin> : <tmax>}]
- X
- X where <tmin> and <tmax> terms are constants or expressions.
- X
- X Both the <tmin> and <tmax> terms are optional. Anything omitted will
- X not be changed, so
- X set trange [:10]
- X changes tmax to 10 without affecting tmin. See also `set urange` and
- X `set parametric`.
- X3 urange
- X?set urange
- X?show urange
- X?urange
- X The `set urange` and `set vrange` commands sets the parametric ranges used
- X to compute x, y, and z values when in `splot` parametric mode. If not in
- X parametric mode (see `set parametric`) then these ranges are not used. This
- X command does not affect x/y autoscaling or x/y ranges.
- X
- X This range may also be specified on the `splot` command line when
- X in parametric mode. See `plot` for more information
- X
- X Syntax:
- X set urange [{<umin> : <umax>}]
- X
- X where <umin> and <umax> terms are constants or expressions.
- X
- X Both the <umin> and <umax> terms are optional. Anything omitted will
- X not be changed, so
- X set urange [:10]
- X changes umax to 10 without affecting umin. See also `set trange`.
- X3 variables
- X?show variables
- X The `show variables` command lists all user-defined variables and
- X their values.
- X
- X Syntax:
- X show variables
- X3 view
- X?set view
- X?show view
- X?view
- X The `set view` command sets the view point for `splot`s. This
- X command controls the way the 3-d coordinates of the plot are mapped
- X into the 2-d screen space. This command provides controls to both
- X rotation and scaling of the plotted data but supports orthographic
- X projections only.
- X
- X Syntax:
- X set view <rot_x> {,{<rot_z>}{,{<scale>}{,<scale_z>}}}
- X show view
- X
- X where <rot_x> and <rot_z> control the rotation angles (in degrees)
- X along a virtual 3-d coordinate system aligned with the screen such
- X that the screen horizontal axis is x, screen vertical axis is y, and
- X the axis perpendicular to the screen is z. <rot_x> is bounded to the
- X [0:180] range with a default of 60 degrees, while <rot_z> is bounded
- X to the [0:360] range with a default of 30 degrees. <scale> controls
- X the scaling of the entire `splot`, while <scale_z> scales the z axis
- X only. Both scales default to 1.0.
- X
- X Examples:
- X set view 60, 30, 1, 1
- X set view ,,0.5
- X
- X The first sets all the four default values. The second changes
- X only scale, to 0.5.
- X
- X See also `set ticslevel`.
- X3 vrange
- X?set vrange
- X?show vrange
- X?vrange
- X The `set vrange` command is similar to the `set urange` command.
- X Please see `set urange`.
- X3 xlabel
- X?set xlabel
- X?show xlabel
- X?xlabel
- X The `set xlabel` command sets the x-axis label that is centered along
- X the x axis. Using the optional x,y screen offsets, the label can be
- X placed anywhere on the plot. `set xlabel` with no parameters clears
- X the label.
- X
- X Syntax:
- X set xlabel {"<label>"} {<xoff>}{,<yoff>}
- X show xlabel
- X
- X Specifying constants <xoff> or <yoff> as optional offsets for the
- X label will move the label <xoff> or <yoff> character screen
- X coordinates. For example,
- X
- X set xlabel -1
- X
- X will change only the x offset of the xlabel, moving the label roughly
- X one character width to the left.
- X
- X (The EEPIC, Imagen, LaTeX, and TPIC drivers allow \\ in a string to specify
- X a newline.)
- X3 xrange
- X?set xrange
- X?show xrange
- X?xrange
- X The `set xrange` command sets the horizontal range that will be
- X displayed. This command turns x axis autoscaling off.
- X
- X This range may also be specified on the `plot` command line.
- X
- X Syntax:
- X set xrange [{<xmin> : <xmax>}]
- X
- X where <xmin> and <xmax> terms are constants or expressions.
- X
- X Both the <xmin> and <xmax> terms are optional. Anything omitted will
- X not be changed, so
- X set xrange [:10]
- X changes xmax to 10 without affecting xmin.
- X3 xtics
- X?set xtics
- X?set noxtics
- X?show xtics
- X?xtics
- X?noxtics
- X Fine control of the x axis tic marks is possible with the
- X `set xtics` command. The x-axis tic marks may be turned off with the
- X `set noxtics` command. They may be turned on (the default state) with
- X `set xtics`.
- X
- X Syntax:
- X set xtics { {<start>, <incr>{, <end>}} |
- X {({"<label>"} <pos> {, {"<label>"} <pos>}...)} }
- X set noxtics
- X show xtics
- X
- X The <start>, <incr>, <end> form specifies that a series of tics will
- X be plotted on the x axis between the x values <start> and <end>
- X with an increment of <incr>. If <end> is not given it is assumed to be
- X infinity. The increment may be negative. For example,
- X set xtics 0,.5,10
- X makes tics at 0, 0.5, 1, 1.5, ..., 9.5, 10.
- X
- X The ("<label>" <pos>, ...) form allows arbitrary tic positions or
- X non-numeric tic labels. A set of tics are a set of positions, each
- X with its own optional label. Note that the label is a string enclosed
- X by quotes, and may be a constant string, such as "hello", or contain
- X formatting information for the tic number (which is the same as the
- X position), such as "%3f clients". See `set format` for more
- X information about this case. The label may even be empty.
- X Examples:
- X set xtics ("low" 0, "medium" 50, "high" 100)
- X set xtics (1,2,4,8,16,32,64,128,256,512,1024)
- X set xtics ("bottom" 0, "" 10, "top" 20)
- X
- X Tics will only be plotted when in range.
- X
- X The `set ytics` and `set noytics` commands work identically.
- X See also the `set format` command.
- X3 xdtics
- X?set xdtics
- X?set noxdtics
- X?show xdtics
- X?xdtics
- X?noxdtics
- X The `set xdtics` commands converts the x axis tic marks to days of
- X the week where 0=Sun and 6=Sat. Overflows are converted modulo 7
- X to dates.
- X
- X Examples:
- X set xdtics
- X
- X Sets x axis tics in days.
- X
- X The `set ydtics` `set zdtics` and `set noydtics` `set nozdtics` commands
- X work identically.
- X See also the `set format` command.
- X
- X3 xmtics
- X?set xmtics
- X?set noxmtics
- X?show xmtics
- X?xmtics
- X?noxmtics
- X The `set xmtics` commands converts the x axis tic marks to months of
- X the years where 1=Jan and 12=Dec. Overflows are converted modulo 12
- X to months.
- X
- X Examples:
- X set xmtics
- X
- X Sets x axis tics into months.
- X
- X The `set ymtics` `set zmtics` and `set noymtics` `set nozmtics` commands
- X work identically.
- X See also the `set format` command.
- X
- X3 xzeroaxis
- X?set xzeroaxis
- X?set noxzeroaxis
- X?show xzeroaxis
- X?xzeroaxis
- X?noxzeroaxis
- X `set xzeroaxis` draws the x-axis. By default, this option is on.
- X `set noxzeroaxis` causes GNUPLOT to omit the x-axis.
- X
- X Syntax:
- X set xzeroaxis
- X set noxzeroaxis
- X show xzeroaxis
- X3 ylabel
- X?set ylabel
- X?show ylabel
- X?ylabel
- X The `set ylabel` command sets the y-axis label. The position of this
- X label depends on the terminal, and can be one of the following three
- X positions (the position can be adjusted with optional parameters).
- X
- X 1. Horizontal text flushed left at the top left of the plot.
- X Terminals that cannot rotate text will probably use this method.
- X
- X 2. Vertical text centered vertically at the left of the plot.
- X Terminals that can rotate text will probably use this method.
- X
- X 3. Horizontal text centered vertically at the left of the plot.
- X The EEPIC, LaTeX and TPIC drivers use this method. The user must insert
- X line breaks using \\ to prevent the ylabel from overwriting
- X the plot. To produce a vertical row of characters, add \\
- X between every printing character (but this is ugly).
- X
- X Syntax:
- X set ylabel {"<label>"} {<xoff>}{,<yoff>}
- X show ylabel
- X
- X With no parameters, the label is cleared. Specifying constants <xoff>
- X or <yoff> as optional offsets for the label will move the label <xoff>
- X or <yoff> character screen coordinates. For example,
- X
- X set ylabel -1
- X
- X will change only the x offset of the ylabel, moving the label roughly
- X one character width left of its default position. This is especially
- X useful with the LaTeX driver.
- X
- X (The EEPIC, Imagen, LaTeX, and TPIC drivers allow \\ in a string to specify
- X a newline.)
- X3 yrange
- X?set yrange
- X?show yrange
- X?yrange
- X The `set yrange` command sets the vertical range that will be
- X displayed. This command turns y axis autoscaling off.
- X
- X This range may also be specified on the `plot` command line.
- X
- X Syntax:
- X set yrange [{<ymin> : <ymax>}]
- X
- X where <ymin> and <ymax> terms are constants or expressions.
- X
- X Both the <ymin> and <ymax> terms are optional. Anything omitted will
- X not be changed, so
- X set yrange [:10]
- X changes ymax to 10 without affecting ymin.
- X3 ytics
- X?set ytics
- X?set noytics
- X?show ytics
- X?ytics
- X?noytics
- X The `set ytics` and `set noytics` commands are similar to the `set xtics`
- X and `set noxtics` commands. Please see `set xtics`.
- X3 ydtics
- X?set ydtics
- X?set noydtics
- X?show ydtics
- X?ydtics
- X?noydtics
- X The `set ydtics` and `set noydtics` commands are similar to the `set xdtics`
- X and `set noxdtics` commands. Please see `set xdtics`.
- X3 ymtics
- X?set ymtics
- X?set noymtics
- X?show ymtics
- X?ymtics
- X?noymtics
- X The `set ymtics` and `set noymtics` commands are similar to the `set xmtics`
- X and `set noxmtics` commands. Please see `set xmtics`.
- X3 yzeroaxis
- X?set yzeroaxis
- X?set noyzeroaxis
- X?show yzeroaxis
- X?yzeroaxis
- X?noyzeroaxis
- X `set yzeroaxis` draws the y-axis. By default, this option is on.
- X `set noyzeroaxis` causes GNUPLOT to omit the y-axis.
- X
- X Syntax:
- X set yzeroaxis
- X set noyzeroaxis
- X show yzeroaxis
- X3 zero
- X?set zero
- X?show zero
- X?zero
- X The `zero` value is the default threshold for values approaching 0.0.
- X GNUPLOT will not plot a point if its imaginary part is greater in
- X magnitude than the `zero` threshold. Axis ranges cannot be less than
- X `zero`. The default `zero` value is 1e-8. This can be changed with
- X the `set zero` command.
- X
- X Syntax:
- X set zero <expression>
- X show zero
- X3 zeroaxis
- X?set zeroaxis
- X?set nozeroaxis
- X?show zeroaxis
- X?zeroaxis
- X?nozeroaxis
- X `set zeroaxis` draws the x-axis and y-axis. By default, this option is
- X on. `set nozeroaxis` causes GNUPLOT to omit the axes, and is
- X equivalent to `set noxzeroaxis; set noyzeroaxis.`
- X
- X Syntax:
- X set zeroaxis
- X set nozeroaxis
- X show zeroaxis
- X See `set xzeroaxis` and `set yzeroaxis`.
- X3 zlabel
- X?set zlabel
- X?show zlabel
- X?zlabel
- X The `set zlabel` command sets the z-axis label that is centered along
- X the z axis. Using the optional x,y screen offsets, the label can be
- X placed anywhere on the plot. `set zlabel` with no parameters clears
- X the label.
- X
- X Syntax:
- X set zlabel {"<label>"} {<xoff>}{,<yoff>}
- X show zlabel
- X
- X Specifying constants <xoff> or <yoff> as optional offsets for the
- X label will move the label <xoff> or <yoff> character screen
- X coordinates. For example,
- X
- X set zlabel ,1
- X
- X will change only the y offset of the zlabel, moving the label roughly
- X one character height up.
- X
- X The zlabel will be drawn whenever surfaces or contours are plotted,
- X in the space above the grid level.
- X
- X (The EEPIC, Imagen, LaTeX, and TPIC drivers allow \\ in a string to specify
- X a newline.)
- X3 zrange
- X?set zrange
- X?show zrange
- X?zrange
- X The `set zrange` command sets the vertical range that will be
- X displayed. This command turns z axis autoscaling off. The zrange is
- X used only by `splot` and is ignored by `plot`.
- X
- X This range may also be specified on the `splot` command line.
- X
- X Syntax:
- X set zrange [{<zmin> : <zmax>}]
- X
- X where <zmin> and <zmax> terms are constants or expressions.
- X
- X Both the <zmin> and <zmax> terms are optional. Anything omitted will
- X not be changed, so
- X set zrange [2:]
- X changes zmin to 2 without affecting zmax.
- X3 ztics
- X?set ztics
- X?set noztics
- X?show ztics
- X?ztics
- X?noztics
- X The `set ztics` and `set noztics` commands are similar to the
- X `set xtics` and `set noxtics` commands. Please see `set xtics`.
- X3 zdtics
- X?set zdtics
- X?set nozdtics
- X?show zdtics
- X?zdtics
- X?nozdtics
- X The `set zdtics` and `set nozdtics` commands are similar to the
- X `set xdtics` and `set noxdtics` commands. Please see `set xdtics`.
- X
- X3 zmtics
- X?set zmtics
- X?set nozmtics
- X?show zmtics
- X?zmtics
- X?nozmtics
- X The `set zmtics` and `set nozmtics` commands are similar to the
- X `set xmtics` and `set noxmtics` commands. Please see `set xmtics`.
- X2 shell
- X?shell
- X The `shell` command spawns an interactive shell. To return to
- X GNUPLOT, type `logout` if using VMS, `exit` or the END-OF-FILE
- X character if using Unix, `endcli` if using AmigaDOS, or `exit` if
- X using MS-DOS or OS/2.
- X
- X A single shell command may be spawned by preceding it with the !
- X character ($ if using VMS) at the beginning of a command line.
- X Control will return immediately to GNUPLOT after this command is
- X executed. For example, in VMS, AmigaDOS, MS-DOS or OS/2,
- X
- X ! dir
- X
- X prints a directory listing and then returns to GNUPLOT.
- X
- X On an Atari, the `!` command first checks whether a shell is already
- X loaded and uses it, if available. This is practical if GNUPLOT is run
- X from `gulam`, for example.
- X2 splot
- X?splot
- X?surface plot
- X Three-dimensional surface and contour plotting is available in
- X GNUPLOT with the `splot` command. See the `plot` command for features
- X common to the `plot` command.
- X
- X See also `set contour`, `set cntrparam`, and `set surface`.
- X
- X3 Binary Data
- X?binary-data
- X?binary files
- X Gnuplot will dynamically determine if a datafile is ASCII or
- X binary. ASCII data files are discussed in the `plot` section.
- X For three dimensions, single precision floats are stored as follows:
- X
- X <ncols> <x0> <x1> <x2> ...
- X <y0> <z0,0> <z0,1> <z0,2> ...
- X <y1> <z1,0> <z1,1> <z1,2> ...
- X
- X which is converted into triplet:
- X
- X <x0> <y0> <z0,0>
- X <x0> <y1> <z0,1>
- X <x0> <y2> <z0,2>
- X
- X <x1> <y0> <z1,0>
- X <x1> <y1> <z1,1>
- X <x1> <y2> <z1,2>
- X
- X These triplets are then converted into gnuplot iso_curves and then
- X uses gnuplot to do the rest of the plotting.
- X
- X A collection of matrix and vector manipulation routines (in C) are
- X provided in `gnubin.c`. The routine to write binary data is
- X
- X int fwrite_matrix(file,m,nrl,nrl,ncl,nch,row_title,column_title)
- X
- X An example of using these routines is provided in the file `bf_test.c`.
- X The corresponding demo file is `demo/binary.dem`.
- X2 start-up
- X?startup
- X?start
- X?.gnuplot
- X When GNUPLOT is run, it looks for an initialization file to load.
- X This file is called `.gnuplot` on Unix and AmigaDOS systems, and
- X `GNUPLOT.INI` on other systems. If this file is not found in the
- X current directory, the program will look for it in the home directory
- X (under AmigaDOS, AtariTOS, MS-DOS and OS/2, the environment variable
- X GNUPLOT should contain the name of this directory). Note: if NOCWDRC
- X is defined during the installation, GNUPLOT will not read from the
- X current directory.
- X
- X If this file is found, GNUPLOT executes the commands in this file.
- X This is most useful for setting the terminal type and defining any
- X functions or variables that are used often.
- X2 substitution
- X?substitution
- X Command-line substitution is specified by a system command enclosed in
- X backquotes. This command is spawned and the output it produces
- X replaces the name of the command (and backquotes) on the command line.
- X
- X Newlines in the output produced by the spawned command are replaced
- X with blanks.
- X
- X Command-line substitution can be used anywhere on the GNUPLOT command
- X line.
- X
- X Example:
- X
- X This will run the program `leastsq` and replace `leastsq` (including
- X backquotes) on the command line with its output:
- X
- X f(x) = `leastsq`
- X
- X or, in VMS
- X
- X f(x) = `run leastsq`
- X2 user-defined
- X?userdefined
- X?variables
- X New user-defined variables and functions of one through five variables may
- X be declared and used anywhere.
- X
- X User-defined function syntax:
- X <function-name> ( <dummy1> {,<dummy2> {, ...} } ) = <expression>
- X
- X where <expression> is defined in terms of <dummy1> through <dummy5>.
- X
- X User-defined variable syntax:
- X <variable-name> = <constant-expression>
- X
- X Examples:
- X w = 2
- X q = floor(tan(pi/2 - 0.1))
- X f(x) = sin(w*x)
- X sinc(x) = sin(pi*x)/(pi*x)
- X delta(t) = (t == 0)
- X ramp(t) = (t > 0) ? t : 0
- X min(a,b) = (a < b) ? a : b
- X comb(n,k) = n!/(k!*(n-k)!)
- X len3d(x,y,z) = sqrt(x*x+y*y+z*z)
- X
- X Note that the variable `pi` is already defined.
- X
- X See `show functions` and `show variables`.
- X2 bugs
- X?bugs
- X The bessel functions do not work for complex arguments.
- X
- X The gamma function does not work for complex arguments.
- X
- X There is a bug in the stdio library for old Sun operating systems
- X (SunOS Sys4-3.2). The "%g" format for 'printf' sometimes incorrectly
- X prints numbers (e.g., 200000.0 as "2"). Thus, tic mark labels may be
- X incorrect on a Sun4 version of GNUPLOT. A work-around is to rescale
- X the data or use the `set format` command to change the tic mark format
- X to "%7.0f" or some other appropriate format. This appears to have been
- X fixed in SunOS 4.0.
- X
- X Another bug: On a Sun3 under SunOS 4.0, and on Sun4's under Sys4-3.2
- X and SunOS 4.0, the 'sscanf' routine incorrectly parses "00 12" with
- X the format "%f %f" and reads 0 and 0 instead of 0 and 12. This
- X affects data input. If the data file contains x coordinates that are
- X zero but are specified like '00', '000', etc, then you will read the
- X wrong y values. Check any data files or upgrade the SunOS.
- X It appears to have been fixed in SunOS 4.1.1.
- X
- X Microsoft C 5.1 has a nasty bug associated with the %g format for
- X printf. When any of the formats "%.2g", "%.1g", "%.0g", "%.g" are
- X used, printf will incorrectly print numbers in the range 1e-4 to 1e-1.
- X Numbers that should be printed in the %e format are incorrectly
- X printed in the %f format, with the wrong number of zeros after the
- X decimal point.
- X
- X To work around this problem, use the %e or %f formats explicitly.
- X
- X GNUPLOT, when compiled with Microsoft C, did not work correctly on two
- X VGA displays that were tested. The CGA, EGA and VGA drivers should
- X probably be rewritten to use the Microsoft C graphics library.
- X GNUPLOT compiled with Borland C++ uses the Turbo C graphics drivers and
- X does work correctly with VGA displays.
- X
- X VAX/VMS 4.7 C compiler release 2.4 also has a poorly implemented %g
- X format for printf. The numbers are printed numerically correct, but
- X may not be in the requested format. The K&R second edition says that
- X for the %g format, %e is used if the exponent is less than -4 or greater
- X than or equal to the precision. The VAX uses %e format if the exponent
- X is less than -1. The VAX appears to take no notice of the precision
- X when deciding whether to use %e or %f for numbers less than 1.
- X To work around this problem, use the %e or %f formats explicitly.
- X From the VAX C 2.4 release notes:
- X e,E,f,F,g,G Result will always contain a decimal point.
- X For g and G, trailing zeros will not be removed from the result.
- X
- X VAX/VMS 5.2 C compiler release 3.0 has a slightly better implemented
- X %g format than release 2.4, but not much. Trailing decimal points are
- X now removed, but trailing zeros are still not removed from %g numbers
- X in exponential format.
- X
- X ULTRIX X11R3 has a bug that causes the X11 driver to display "every
- X other" plot. The bug seems to be fixed in DEC's release of X11R4 so
- X newer releases of ULTRIX don't seem to have the problem. Solutions for
- X older sites include upgrading the X11 libraries (from DEC or direct from
- X MIT) or defining ULTRIX_KLUDGE when compiling the x11.trm file. Note
- X that the kludge is not an ideal fix, however.
- X
- X The constant HUGE was incorrectly defined in the NeXT OS 2.0 operating
- X system. HUGE should be set to 1e38 in plot.h. This error has been
- X corrected in the 2.1 version of NeXT OS.
- X
- X Some older models of HP plotters do not have a page eject command 'PG'.
- X The current HPGL driver uses this command in HPGL_reset. This may need
- X to be removed for these plotters. The current PCL5 driver uses HPGL/2
- X for text as well as graphics. This should be modified to use scalable
- X PCL fonts.
- X
- X On the Atari version, it is not possible to send output directly to
- X the printer (using `/dev/lp` as output file), since CRs are added to LFs in
- X binary output. As a workaround write the output to a file and copy it to
- X the printer afterwards using a shell command.
- X
- X Please report any bugs to bug-gnuplot@dartmouth.edu.
- END_OF_FILE
- if test 63916 -ne `wc -c <'gnuplot/docs/gnuplot.doc.B'`; then
- echo shar: \"'gnuplot/docs/gnuplot.doc.B'\" unpacked with wrong size!
- elif test -f 'gnuplot/docs/gnuplot.doc.A' ; then
- echo shar: Combining \"'gnuplot/docs/gnuplot.doc'\" \(129941 characters\)
- cat 'gnuplot/docs/gnuplot.doc.A' 'gnuplot/docs/gnuplot.doc.B' > 'gnuplot/docs/gnuplot.doc'
- if test 129941 -ne `wc -c <'gnuplot/docs/gnuplot.doc'`; then
- echo shar: \"'gnuplot/docs/gnuplot.doc'\" combined with wrong size!
- else
- rm gnuplot/docs/gnuplot.doc.A gnuplot/docs/gnuplot.doc.B
- fi
- fi
- # end of 'gnuplot/docs/gnuplot.doc.B'
- fi
- if test -f 'gnuplot/os2/print.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'gnuplot/os2/print.c'\"
- else
- echo shar: Extracting \"'gnuplot/os2/print.c'\" \(13292 characters\)
- sed "s/^X//" >'gnuplot/os2/print.c' <<'END_OF_FILE'
- X#ifdef INCRCSDATA
- Xstatic char RCSid[]="$Id: print.c%v 3.50 1993/07/09 05:35:24 woo Exp $" ;
- X#endif
- X
- X/****************************************************************************
- X
- X PROGRAM: gnupmdrv
- X
- X Outboard PM driver for GNUPLOT 3.3
- X
- X MODULE: print.c -- support for printing graphics under OS/2
- X
- X****************************************************************************/
- X
- X/*
- X * PM driver for GNUPLOT
- X * Copyright (C) 1992 Roger Fearick
- X *
- X * Permission to use, copy, and distribute this software and its
- X * documentation for any purpose with or without fee is hereby granted,
- X * provided that the above copyright notice appear in all copies and
- X * that both that copyright notice and this permission notice appear
- X * in supporting documentation.
- X *
- X * Permission to modify the software is granted, but not the right to
- X * distribute the modified code. Modifications are to be distributed
- X * as patches to released version.
- X *
- X * This software is provided "as is" without express or implied warranty.
- X *
- X *
- X * AUTHOR
- X *
- X * Gnuplot driver for OS/2: Roger Fearick
- X *
- X * Send your comments or suggestions to
- X * info-gnuplot@dartmouth.edu.
- X * This is a mailing list; to join it send a note to
- X * info-gnuplot-request@dartmouth.edu.
- X * Send bug reports to
- X * bug-gnuplot@dartmouth.edu.
- X**/
- X
- X#define INCL_SPLDOSPRINT
- X#define INCL_DOSPROCESS
- X#define INCL_DOSSEMAPHORES
- X#define INCL_DEV
- X#define INCL_SPL
- X#define INCL_PM
- X#define INCL_WIN
- X#include <os2.h>
- X#include <stdio.h>
- X#include <stdlib.h>
- X#include <string.h>
- X#include <process.h>
- X#include "gnupmdrv.h"
- X
- Xtypedef struct { /* for print thread parameters */
- X HWND hwnd ;
- X char szPrintFile[256] ; /* file for printer output if not to printer */
- X PPRQINFO3 piPrinter ; /* print queue info */
- X } PRINTPARAMS ;
- X
- Xstatic struct {
- X long lTech ; // printer technology
- X long lVer ; // driver version
- X long lWidth ; // page width in pels
- X long lHeight ; // page height in pels
- X long lWChars ; // page width in chars
- X long lHChars ; // page height in chars
- X long lHorRes ; // horizontal resolution pels / metre
- X long lVertRes ; // vertical resolution pels / metre
- X } prCaps ;
- X
- Xstatic float flXFrac = (float) 0.6 ; /* print area fractions */
- Xstatic float flYFrac = (float) 0.5 ;
- X
- Xstatic DRIVDATA driv = {sizeof( DRIVDATA) } ;
- Xstatic PDRIVDATA pdriv = NULL ;
- Xstatic char szPrintFile[CCHMAXPATHCOMP] = {0} ;
- Xstatic DEVOPENSTRUC devop ;
- X
- Xvoid ThreadPrintPage( PRINTPARAMS* ) ;
- X
- XMPARAM PrintCmdProc( HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
- X/*
- X** Handle messages for print commands for 1- and 2-d spectra
- X** (i.e for the appropriate 1-and 2-d child windows )
- X*/
- X {
- X static BYTE abStack[4096] ;
- X static PRINTPARAMS tp ;
- X static char szBusy[] = "Busy - try again later" ;
- X static char szStart[] = "Printing started" ;
- X static HEV semPrint = 0L ;
- X char szTemp[32] ;
- X long lErr ;
- X PBYTE pStack = abStack;
- X TID tid ;
- X char *pszMess, *szPrinter ;
- X
- X if( semPrint == 0L ) {
- X DosCreateMutexSem( NULL, &semPrint, 0L, 0L ) ;
- X }
- X
- X switch( msg ) {
- X
- X case WM_USER_PRINT_BEGIN:
- X
- X if( DosRequestMutexSem( semPrint, SEM_IMMEDIATE_RETURN ) != 0 ) {
- X pszMess = szBusy ;
- X WinMessageBox( HWND_DESKTOP,
- X hWnd,
- X pszMess,
- X APP_NAME,
- X 0,
- X MB_OK | MB_ICONEXCLAMATION ) ;
- X }
- X else {
- X pszMess = szStart ;
- X tp.hwnd = hWnd ;
- X tp.piPrinter = (PPRQINFO3) mp1 ;
- X strcpy( tp.szPrintFile, szPrintFile ) ;
- X DosCreateThread( &tid, (PFNTHREAD)ThreadPrintPage, (ULONG)&tp, 0L, 8192L ) ;
- X }
- X break ;
- X
- X
- X case WM_USER_PRINT_OK :
- X
- X WinMessageBox( HWND_DESKTOP,
- X hWnd,
- X "Print done",
- X APP_NAME,
- X 0,
- X MB_OK | MB_ICONEXCLAMATION ) ;
- X DosReleaseMutexSem( semPrint ) ;
- X break ;
- X
- X case WM_USER_DEV_ERROR :
- X
- X lErr = ERRORIDERROR( (ERRORID) mp1 ) ;
- X sprintf( szTemp, "Dev error: %d %x", lErr, lErr ) ;
- X WinMessageBox( HWND_DESKTOP,
- X hWnd,
- X szTemp,
- X APP_NAME,
- X 0,
- X MB_OK | MB_ICONEXCLAMATION ) ;
- X DosReleaseMutexSem( semPrint ) ;
- X break ;
- X
- X case WM_USER_PRINT_ERROR :
- X
- X lErr = ERRORIDERROR( (ERRORID) mp1 ) ;
- X sprintf( szTemp, "Print error: %d %x", lErr, lErr ) ;
- X WinMessageBox( HWND_DESKTOP,
- X hWnd,
- X szTemp,
- X APP_NAME,
- X 0,
- X MB_OK | MB_ICONEXCLAMATION ) ;
- X DosReleaseMutexSem( semPrint ) ;
- X break ;
- X
- X case WM_USER_PRINT_QBUSY :
- X
- X return( (MPARAM)DosRequestMutexSem( semPrint, SEM_IMMEDIATE_RETURN ) ) ;
- X
- X default : break ;
- X }
- X
- X return 0L ;
- X }
- X
- Xint SetupPrinter( HWND hwnd, char *szPrintername, PPRQINFO3 pinfPrinter )
- X/*
- X** Set up the printer
- X**
- X*/
- X {
- X QPRINT qp ;
- X
- X HDC hdc ;
- X /* check that printer is still around .. */
- X if( FindPrinter( szPrintername, pinfPrinter ) != 0 ) return 0 ;
- X qp.piPrinter = pinfPrinter ;
- X /* get printer capabilities */
- X if( (hdc = OpenPrinterDC( WinQueryAnchorBlock( hwnd ), pinfPrinter, OD_INFO, NULL )) != DEV_ERROR ) {
- X DevQueryCaps( hdc, CAPS_TECHNOLOGY, (long)sizeof(prCaps)/sizeof(long), (PLONG)&prCaps ) ;
- X DevCloseDC( hdc ) ;
- X qp.xsize = (float)100.0* (float) prCaps.lWidth / (float) prCaps.lHorRes ; // in cm
- X qp.ysize = (float)100.0* (float) prCaps.lHeight / (float) prCaps.lVertRes ; // in cm
- X qp.xfrac = flXFrac ;
- X qp.yfrac = flYFrac ;
- X qp.szFilename[0] = 0 ;
- X szPrintFile[0] = 0 ;
- X qp.caps = prCaps.lTech & (CAPS_TECH_VECTOR_PLOTTER|CAPS_TECH_POSTSCRIPT) ?
- X QP_CAPS_FILE : QP_CAPS_NORMAL ;
- X if( WinDlgBox( HWND_DESKTOP,
- X hwnd,
- X (PFNWP)QPrintDlgProc,
- X 0L,
- X ID_QPRINT,
- X &qp ) == DID_OK ) {
- X flXFrac = qp.xfrac ;
- X flYFrac = qp.yfrac ;
- X if( qp.caps & QP_CAPS_FILE ) {
- X if( qp.szFilename[0] != 0 ) strcpy( szPrintFile, qp.szFilename ) ;
- X }
- X return 1 ;
- X }
- X }
- X return 0 ;
- X }
- X
- Xint SetPrinterMode( HWND hwnd, PPRQINFO3 pinfo )
- X/*
- X** call up printer driver's own setup dialog box
- X**
- X** returns : -1 if error
- X** 0 if no settable modes
- X** 1 if OK
- X*/
- X {
- X HAB hab ;
- X LONG lBytes ;
- X
- X hab = WinQueryAnchorBlock( hwnd ) ;
- X lBytes = DevPostDeviceModes( hab,
- X NULL,
- X devop.pszDriverName,
- X driv.szDeviceName,
- X NULL,
- X DPDM_POSTJOBPROP ) ;
- X if( lBytes > 0L ) {
- X /* if we have old pdriv data, and if its for the same printer,
- X keep it to retain user's current settings, else get new */
- X if( pdriv != NULL
- X && strcmp( pdriv->szDeviceName, pinfo->pDriverData->szDeviceName ) != 0 ) {
- X free( pdriv ) ;
- X pdriv = NULL ;
- X }
- X if( pdriv == NULL ) {
- X if( lBytes < pinfo->pDriverData->cb ) lBytes = pinfo->pDriverData->cb ;
- X pdriv = malloc( lBytes ) ;
- X memcpy( pdriv, pinfo->pDriverData, pinfo->pDriverData->cb ) ;
- X }
- X pdriv->szDeviceName[0] = '\0' ; /* to check if 'cancel' selected */
- X lBytes = DevPostDeviceModes( hab,
- X pdriv,
- X devop.pszDriverName,
- X driv.szDeviceName,
- X NULL,
- X DPDM_POSTJOBPROP ) ;
- X if( pdriv->szDeviceName[0] == '\0' ) { /* could be: 'cancel' selected */
- X lBytes = 0 ;
- X free(pdriv ) ; /* is this right ???? */
- X pdriv = NULL ;
- X }
- X }
- X return ( (int) lBytes ) ;
- X }
- X
- Xvoid ThreadPrintPage( PRINTPARAMS *ptp )
- X/*
- X** thread to set up printer DC and print page
- X**
- X** Input: THREADPARAMS *ptp -- pointer to thread data passed by beginthread
- X**
- X*/
- X {
- X HAB hab ; // thread anchor block nandle
- X HDC hdc ; // printer device context handle
- X HPS hps ; // presentation space handle
- X SHORT msgRet ; // message posted prior to return (end of thread)
- X SIZEL sizPage ; // size of page for creation of presentation space
- X LONG alPage[2] ; // actual size of printer page in pixels
- X RECTL rectPage ; // viewport on page into which we draw
- X LONG lColors ;
- X char *szPrintFile ;
- X
- X hab = WinInitialize( 0 ) ;
- X
- X szPrintFile = ptp->szPrintFile[0] == '\0' ? NULL : ptp->szPrintFile ;
- X
- X if( (hdc = OpenPrinterDC( hab, ptp->piPrinter, 0L, szPrintFile )) != DEV_ERROR ) {
- X
- X // create presentation space for printer
- X
- X sizPage.cx = 0 ;
- X sizPage.cy = 0 ;
- X hps = GpiCreatePS( hab,
- X hdc,
- X &sizPage,
- X PU_ARBITRARY | GPIF_DEFAULT | GPIT_MICRO | GPIA_ASSOC ) ;
- X
- X DevQueryCaps( hdc, CAPS_WIDTH, 2L, alPage ) ;
- X DevQueryCaps( hdc, CAPS_PHYS_COLORS, 1L, &lColors ) ;
- X rectPage.xLeft = 0L ;
- X rectPage.xRight = alPage[0]*flXFrac ;
- X rectPage.yTop = alPage[1]*flYFrac ;//alPage[1]*(1.0-flYFrac) ;
- X rectPage.yBottom = 0L ; // = alPage[1] ;
- X
- X // start printing
- X
- X if( DevEscape( hdc,
- X DEVESC_STARTDOC,
- X 7L,
- X APP_NAME,
- X NULL,
- X NULL ) != DEVESC_ERROR ) {
- X
- X ScalePS( hps, &rectPage, 0 ) ;
- X PlotThings( hps, lColors ) ;
- X DevEscape( hdc, DEVESC_ENDDOC, 0L, NULL, NULL, NULL ) ;
- X msgRet = WM_USER_PRINT_OK ;
- X }
- X else
- X msgRet = WM_USER_PRINT_ERROR ;
- X
- X GpiDestroyPS( hps ) ;
- X DevCloseDC( hdc ) ;
- X }
- X else
- X msgRet = WM_USER_DEV_ERROR ;
- X
- X DosEnterCritSec() ;
- X WinPostMsg( ptp->hwnd, msgRet, (MPARAM)WinGetLastError(hab), 0L ) ;
- X WinTerminate( hab ) ;
- X }
- X
- XHDC OpenPrinterDC( HAB hab, PPRQINFO3 pqinf, LONG lMode, char *szPrintFile )
- X/*
- X** get printer info from os2.ini and set up DC
- X**
- X** Input: HAB hab -- handle of anchor block of printing thread
- X** PPRQINFO3-- pointer to data of current selected printer
- X** LONG lMode -- mode in which device context is opened = OD_QUEUED, OD_DIRECT, OD_INFO
- X** char *szPrintFile -- name of file for printer output, NULL
- X** if to printer (only used for devices that support file
- X** output eg plotter, postscript)
- X**
- X** Return: HDC -- handle of printer device context
- X** = DEV_ERROR (=0) if error
- X*/
- X {
- X CHAR *pchDelimiter ;
- X LONG lType ;
- X static CHAR achPrinterData[256] ;
- X
- X if( pqinf == NULL ) return DEV_ERROR ;
- X
- X strcpy( achPrinterData, pqinf->pszDriverName ) ;
- X achPrinterData[ strcspn(achPrinterData,".") ] = '\0' ;
- X
- X devop.pszDriverName = achPrinterData ;
- X devop.pszLogAddress = pqinf->pszName ;
- X
- X if( (pdriv != NULL ) ) devop.pdriv = pdriv ;
- X else devop.pdriv = pqinf->pDriverData ;
- X
- X if( szPrintFile != NULL ) devop.pszLogAddress = szPrintFile ;
- X
- X // set data type to RAW
- X
- X devop.pszDataType = "PM_Q_RAW" ;
- X
- X // open device context
- X if( lMode != 0L )
- X lType = lMode ;
- X else
- X lType = (szPrintFile == NULL) ? OD_QUEUED: OD_DIRECT ;
- X
- X return DevOpenDC( hab, // WinQueryAnchorBlock( hwnd ),
- X lType,
- X "*",
- X 4L,
- X (PDEVOPENDATA) &devop,
- X NULLHANDLE ) ;
- X }
- X
- Xint FindPrinter( char *szName, PPRQINFO3 piPrinter )
- X/*
- X** Find a valid printer
- X*/
- X {
- X PPRQINFO3 pprq ;
- X int np ;
- X
- X if( *szName && (strcmp( szName, piPrinter->pszName ) == 0) ) return 0 ;
- X if( GetPrinters( &pprq , &np ) == 0 ) return 1 ;
- X for( --np; np>=0; np-- ) {
- X if( strcmp( szName, pprq[np].pszName ) == 0 ) {
- X memcpy( piPrinter, &pprq[np], sizeof( PRQINFO3 ) ) ;
- X free( pprq ) ;
- X return 0 ;
- X }
- X }
- X memcpy( piPrinter, &pprq[0], sizeof( PRQINFO3 ) ) ;
- X free( pprq ) ;
- X return 0 ;
- X }
- END_OF_FILE
- if test 13292 -ne `wc -c <'gnuplot/os2/print.c'`; then
- echo shar: \"'gnuplot/os2/print.c'\" unpacked with wrong size!
- fi
- # end of 'gnuplot/os2/print.c'
- fi
- echo shar: End of archive 4 \(of 33\).
- cp /dev/null ark4isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 33 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-