Credits Overview Plotting Styles Commands Terminals

pslatex and pstex

The pslatex driver generates output for further processing by LaTeX, while the pstex driver generates output for further processing by TeX. pslatex uses \specials understandable by dvips and xdvi. Figures generated by pstex can be included in any plain-based format (including LaTeX).

Syntax:

      set terminal [pslatex | pstex] {default}
      set terminal [pslatex | pstex]
                              {rotate | norotate}
                              {auxfile | noauxfile}
                              {level1 | leveldefault | level3}
                              {color | colour | monochrome}
                              {background <rgbcolor> | nobackground}
                              {dashlength | dl <DL>}
                              {linewidth | lw <LW>} {pointscale | ps <PS>}
                              {rounded | butt}
                              {clip | noclip}
                              {palfuncparam <samples>{,<maxdeviation>}}
                              {size <XX>{unit},<YY>{unit}}
                              {<font_size>}

If you see the error message

      "Can't find PostScript prologue file ... "

Please see and follow the instructions in postscript prologue.

The option color enables color, while monochrome prefers black and white drawing elements. Further, monochrome uses gray palette but it does not change color of objects specified with an explicit colorspec. dashlength or dl scales the length of dashed-line segments by <DL>, which is a floating-point number greater than zero. linewidth or lw scales all linewidths by <LW>.

By default the generated PostScript code uses language features that were introduced in PostScript Level 2, notably filters and pattern-fill of irregular objects such as filledcurves. PostScript Level 2 features are conditionally protected so that PostScript Level 1 interpreters do not issue errors but, rather, display a message or a PostScript Level 1 approximation. The level1 option substitutes PostScript Level 1 approximations of these features and uses no PostScript Level 2 code. This may be required by some old printers and old versions of Adobe Illustrator. The flag level1 can be toggled later by editing a single line in the PostScript output file to force PostScript Level 1 interpretation. In the case of files containing level 2 code, the above features will not appear or will be replaced by a note when this flag is set or when the interpreting program does not indicate that it understands level 2 PostScript or higher. The flag level3 enables PNG encoding for bitmapped images, which can reduce the output size considerably.

rounded sets line caps and line joins to be rounded; butt is the default, butt caps and mitered joins.

clip tells PostScript to clip all output to the bounding box; noclip is the default.

palfuncparam controls how set palette functions are encoded as gradients in the output. Analytic color component functions (set via set palette functions) are encoded as linear interpolated gradients in the postscript output: The color component functions are sampled at <samples> points and all points are removed from this gradient which can be removed without changing the resulting colors by more than <maxdeviation>. For almost every useful palette you may safely leave the defaults of <samples>=2000 and <maxdeviation>=0.003 untouched.

The default size for postscript output is 10 inches x 7 inches. The default for eps output is 5 x 3.5 inches. The size option changes this to whatever the user requests. By default the X and Y sizes are taken to be in inches, but other units are possibly (currently only cm). The BoundingBox of the plot is correctly adjusted to contain the resized image. Screen coordinates always run from 0.0 to 1.0 along the full length of the plot edges as specified by the size option.

if rotate is specified, the y-axis label is rotated. <font_size> is the size (in pts) of the desired font.

If auxfile is specified, it directs the driver to put the PostScript commands into an auxiliary file instead of directly into the LaTeX file. This is useful if your pictures are large enough that dvips cannot handle them. The name of the auxiliary PostScript file is derived from the name of the TeX file given on the set output command; it is determined by replacing the trailing .tex (actually just the final extent in the file name) with .ps in the output file name, or, if the TeX file has no extension, .ps is appended. The .ps is included into the .tex file by a \special{psfile=...} command. Remember to close the output file before next plot unless in multiplot mode.

The pslatex driver offers a special way of controlling text positioning: (a) If any text string begins with '{', you also need to include a '}' at the end of the text, and the whole text will be centered both horizontally and vertically by LaTeX. (b) If the text string begins with '[', you need to continue it with: a position specification (up to two out of t,b,l,r), ']{', the text itself, and finally, '}'. The text itself may be anything LaTeX can typeset as an LR-box. \rule{}{}'s may help for best positioning.

The options not described here are identical to the Postscript terminal. Look there if you want to know what they do.

Examples:

      set term pslatex monochrome rotate       # set to defaults

To write the PostScript commands into the file "foo.ps":

      set term pslatex auxfile
      set output "foo.tex"; plot ...; set output

About label positioning: Use gnuplot defaults (mostly sensible, but sometimes not really best):

       set title '\LaTeX\ -- $ \gamma $'

Force centering both horizontally and vertically:

       set label '{\LaTeX\ -- $ \gamma $}' at 0,0

Specify own positioning (top here):

       set xlabel '[t]{\LaTeX\ -- $ \gamma $}'

The other label -- account for long ticlabels:

       set ylabel '[r]{\LaTeX\ -- $ \gamma $\rule{7mm}{0pt}}'

Linewidths and pointsizes may be changed with set style line.