next up previous contents index
Next: Pstricks Up: Terminal Previous: Postscript prologue   Contents   Index


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 3#3specials 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}
                             {oldstyle | newstyle}
                             {auxfile | noauxfile}
                             {level1 | leveldefault}
                             {color | colour | monochrome}
                             {solid | dashed}
                             {dashlength | dl <DL>}
                             {linewidth | lw <LW>}
                             {rounded | butt}
                             {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 (p. [*]).

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. solid draws all plots with solid lines, overriding any dashed patterns. dashlength or dl scales the length of the dashed-line segments by 5#5DL6#6, which is a floating-point number greater than zero. linewidth or lw scales all linewidths by 5#5LW6#6.

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.

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

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 5#5samples6#6 points and all points are removed from this gradient which can be removed without changing the resulting colors by more than 5#5maxdeviation6#6. For almost every useful palette you may savely leave the defaults of 5#5samples6#6=2000 and 5#5maxdeviation6#6=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. NB: this is a change from the previously recommended method of using the set size command prior to setting the terminal type. The old method left the BoundingBox unchanged and screen coordinates did not correspond to the actual limits of the plot.

if rotate is specified, the y-axis label is rotated. 5#5font_size6#6 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 3#3special{psfile=...} command. Remember to close the output file before next plot unless in multiplot mode.

Gnuplot versions prior version 4.2 have generated plots of the size 5 x 3 inches using the ps(la)tex terminal while the current version generates 5 x 3.5 inches to be consistent with the postscript eps terminal. In addition, the character width is now estimated to be 60% of the font size while the old epslatex terminal used 50%. To reach the old format specify the option oldstyle.

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. 3#3rule{}{}'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 dashed 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.


next up previous contents index
Next: Pstricks Up: Terminal Previous: Postscript prologue   Contents   Index
Ethan Merritt 2007-03-03