01.02.2014 Views

GNUPlot Manual

GNUPlot Manual

GNUPlot Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

128 gnuplot 4.0 36 SET-SHOW<br />

You can escape control characters using \, e.g., \\, \{, and so on.<br />

But be aware that strings in double-quotes are parsed differently than those enclosed in single-quotes.<br />

The major difference is that backslashes may need to be doubled when in double-quoted strings.<br />

Examples (these are hard to describe in words — try them!):<br />

set xlabel ’Time (10^6 {/Symbol m}s)’<br />

set title ’{/Symbol=18 \362@_{/=9.6 0}^{/=12 x}} \<br />

{/Helvetica e^{-{/Symbol m}^2/2} d}{/Symbol m}’<br />

The file "ps guide.ps" in the /docs/psdoc subdirectory of the gnuplot source distribution contains more<br />

examples of the enhanced syntax.<br />

36.59.55.2 Editing postscript The PostScript language is a very complex language — far too<br />

complex to describe in any detail in this document. Nevertheless there are some things in a PostScript<br />

file written by gnuplot that can be changed without risk of introducing fatal errors into the file.<br />

For example, the PostScript statement "/Color true def" (written into the file in response to the command<br />

set terminal postscript color), may be altered in an obvious way to generate a black-and-white version<br />

of a plot. Similarly line colors, text colors, line weights and symbol sizes can also be altered in straightforward<br />

ways. Text (titles and labels) can be edited to correct misspellings or to change fonts. Anything<br />

can be repositioned, and of course anything can be added or deleted, but modifications such as these<br />

may require deeper knowledge of the PostScript language.<br />

The organization of a PostScript file written by gnuplot is discussed in the text file "ps file.doc" in the<br />

docs/ps subdirectory of the gnuplot source distribution.<br />

36.59.55.3 Postscript fontfile The fontfile or fontfile add option takes one file name as argument<br />

and encapsulates this file into the postscript output in order to make this font available for text elements<br />

(labels, tic marks, titles, etc.). The fontfile delete option also takes one file name as argument. It<br />

deletes this file name from the list of encapsulated files.<br />

The postscript terminal understands some font file formats: Type 1 fonts in ASCII file format (extension<br />

".pfa"), Type 1 fonts in binary file format (extension ".pfb"), and TrueType fonts (extension ".ttf").<br />

Pfa files are understood directly, pfb and ttf files are converted on the fly if appropriate conversion tools<br />

are installed (see below). You have to specify the full filename with the extension. Each fontfile option<br />

takes exact one font file name. This option can be used multiple times in order to include more than<br />

one font file.<br />

The font file is searched in the working directory and in all directories listed in the fontpath which<br />

is determined by set fontpath. In addition, the fontpath can be set using the environment variable<br />

GNUPLOT FONTPATH. If this is not set a system dependent default search list is used. See set<br />

fontpath (p. 65) for more details.<br />

For using the encapsulated font file you have to specify the font name (which normally is not the same<br />

as the file name). When embedding a font file by using the fontfile option in interactive mode, the font<br />

name is printed on the screen. E.g.<br />

Font file ’p052004l.pfb’ contains the font ’URWPalladioL-Bold’. Location:<br />

/usr/lib/X11/fonts/URW/p052004l.pfb<br />

When using pfa or pfb fonts, you can also find it out by looking into the font file. There is a line similar<br />

to "/FontName /URWPalladioL-Bold def". The middle string without the slash is the fontname, here<br />

"URWPalladioL-Bold". For TrueType fonts, this is not so easy since the font name is stored in a binary<br />

format. In addition, they often have spaces in the font names which is not supported by Type 1 fonts<br />

(in which a TrueType is converted on the fly). The font names are changed in order to eliminate the<br />

spaces in the fontnames. The easiest way to find out which font name is generated for use with gnuplot,<br />

start gnuplot in interactive mode and type in "set terminal postscript fontfile ’’".<br />

For converting font files to pfa format the conversion tool has to read the font from a file and write it<br />

to standard output. For pfb files "pfbtops" is a tool which can do this. If this program is installed on<br />

your system the on the fly conversion should work. Just try to encapsulate a pfb file. If the compiled

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!