Credits | Overview | Plotting Styles | Commands | Terminals
--- | --- | --- | --- | ---

## postscript

Several options may be set in the postscript driver.

Syntax:

          set terminal postscript {default}
          set terminal postscript {landscape | portrait | eps}
                                  {enhanced | noenhanced}
                                  {defaultplex | simplex | duplex}
                                  {fontfile {add | delete} "<filename>"
                                   | nofontfiles} {{no}adobeglyphnames}
                                  {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}}
                                  {blacktext | colortext | colourtext}
                                  {{font} "fontname{,fontsize}" {<fontsize>}}
                                  {fontscale <scale>}

If you see the error message

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

Please see and follow the instructions in postscript prologue.

landscape and portrait choose the plot orientation. eps mode generates EPS (Encapsulated PostScript) output, which is just regular PostScript with some additional lines that allow the file to be imported into a variety of other applications. (The added lines are PostScript comment lines, so the file may still be printed by itself.) To get EPS output, use the eps mode and make only one plot per file. In eps mode the whole plot, including the fonts, is reduced to half of the default size.

enhanced enables enhanced text mode features (subscripts, superscripts and mixed fonts). See enhanced for more information. blacktext forces all text to be written in black even in color mode;

Duplexing in PostScript is the ability of the printer to print on both sides of the same sheet of paper. With defaultplex, the default setting of the printer is used; with simplex only one side is printed; duplex prints on both sides (ignored if your printer can't do it).

"<fontname>" is the name of a valid PostScript font; and <fontsize> is the size of the font in PostScript points. In addition to the standard postscript fonts, an oblique version of the Symbol font, useful for mathematics, is defined. It is called "Symbol-Oblique".

default sets all options to their defaults: landscape, monochrome, dl 1.0, lw 1.0, defaultplex, enhanced, "Helvetica" and 14pt. Default size of a PostScript plot is 10 inches wide and 7 inches high. 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.

Fonts listed by fontfile or fontfile add encapsulate the font definitions of the listed font from a postscript Type 1 or TrueType font file directly into the gnuplot output postscript file. Thus, the enclosed font can be used in labels, titles, etc. See the section postscript fontfile for more details. With fontfile delete, a fontfile is deleted from the list of embedded files. nofontfiles cleans the list of embedded fonts.

The postscript driver supports about 70 distinct pointtypes, selectable through the pointtype option on plot and set linetype.

Several possibly useful files about gnuplot's PostScript are included in the /docs/psdoc subdirectory of the gnuplot distribution and at the distribution sites. These are "ps_symbols.gpi" (a gnuplot command file that, when executed, creates the file "ps_symbols.ps" which shows all the symbols available through the postscript terminal), "ps_guide.ps" (a PostScript file that contains a summary of the enhanced syntax and a page showing what the octal codes produce with text and symbol fonts), "ps_file.doc" (a text file that contains a discussion of the organization of a PostScript file written by gnuplot), and "ps_fontfile_doc.tex" (a LaTeX file which contains a short documentation concerning the encapsulation of LaTeX fonts with a glyph table of the math fonts).

A PostScript file is editable, so once gnuplot has created one, you are free to modify it to your heart's desire. See the editing postscript section for some hints.

Subtopics

- editing postscript
- postscript fontfile

- postscript prologue
- postscript adobeglyphnames