Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
pmi432 / LR02 / Books / gnuplot 4.6 manual.pdf
Скачиваний:
55
Добавлен:
18.03.2015
Размер:
2.22 Mб
Скачать

gnuplot 4.6

207

Pdfcairo

The pdfcairo terminal device generates output in pdf. The actual drawing is done via cairo, a 2D graphics library, and pango, a library for laying out and rendering text.

Syntax:

set term pdfcairo

{{no}enhanced} {mono|color} {solid|dashed} {font <font>} {fontscale <scale>}

{linewidth <lw>} {rounded|butt} {dashlength <dl>} {size <XX>{unit},<YY>{unit}}

This terminal supports an enhanced text mode, which allows font and other formatting commands (subscripts, superscripts, etc.) to be embedded in labels and other text strings. The enhanced text mode syntax is shared with other gnuplot terminal types. See enhanced (p. 23) for more details.

The width of all lines in the plot can be modi ed by the factor <lw> speci ed in linewidth. The default linewidth is 0.25 points. (1 "PostScript" point = 1/72 inch = 0.353 mm)

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

The default size for the output is 5 inches x 3 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 possible (currently only cm). Screen coordinates always run from 0.0 to 1.0 along the full length of the plot edges as speci ed by the size option.

<font> is in the format "FontFace,FontSize", i.e. the face and the size comma-separated in a single string. FontFace is a usual font face name, such as 'Arial'. If you do not provide FontFace, the pdfcairo terminal will use 'Sans'. FontSize is the font size, in points. If you do not provide it, the pdfcairo terminal will use a nominal font size of 12 points. However, the default fontscale parameter for this terminal is 0.5, so the apparent font size is smaller than this if the pdf output is viewed at full size.

For example :

set term pdfcairo font "Arial,12"

set term pdfcairo font "Arial" # to change the font face only set term pdfcairo font ",12" # to change the font size only set term pdfcairo font "" # to reset the font name and size

The fonts are retrieved from the usual fonts subsystems. Under Windows, those fonts are to be found and con gured in the entry "Fonts" of the control panel. Under UNIX, they are handled by "fontcon g".

Pango, the library used to layout the text, is based on utf-8. Thus, the pdfcairo terminal has to convert from your encoding to utf-8. The default input encoding is based on your 'locale'. If you want to use another encoding, make sure gnuplot knows which one you are using. See encoding (p. 110) for more details.

Pango may give unexpected results with fonts that do not respect the unicode mapping. With the Symbol font, for example, the pdfcairo terminal will use the map provided by http://www.unicode.org/ to translate character codes to unicode. Note that "the Symbol font" is to be understood as the Adobe Symbol font, distributed with Acrobat Reader as "SY .PFB". Alternatively, the OpenSymbol font, distributed with OpenO ce.org as "opens .ttf", o ers the same characters. Microsoft has distributed a Symbol font ("symbol.ttf"), but it has a di erent character set with several missing or moved mathematic characters. If you experience problems with your default setup (if the demo enhancedtext.dem is not displayed properly for example), you probably have to install one of the Adobe or OpenO ce Symbol fonts, and remove the Microsoft one. Other non-conform fonts, such as "wingdings" have been observed working.

The rendering of the plot cannot be altered yet. To obtain the best output possible, the rendering involves two mechanisms : antialiasing and oversampling. Antialiasing allows to display non-horizontal and non-vertical lines smoother. Oversampling combined with antialiasing provides subpixel accuracy, so that gnuplot can draw a line from non-integer coordinates. This avoids wobbling e ects on diagonal lines ('plot x' for example).

Pm

The pm terminal driver provides an OS/2 Presentation Manager window in which the graph is plotted. The window is opened when the rst graph is plotted. This window has its own online help as well as facilities

208

gnuplot 4.6

for printing, copying to the clipboard and some line type and color adjustments. The multiplot option is supported.

Syntax:

set terminal pm {server {n}} {persist} {widelines} {enhanced} {"title"}

If persist is speci ed, each graph appears in its own window and all windows remain open after gnuplot exits. If server is speci ed, all graphs appear in the same window, which remains open when gnuplot exits. This option takes an optional numerical argument which speci es an instance of the server process. Thus multiple server windows can be in use at the same time.

If widelines is speci ed, all plots will be drawn with wide lines. If enhanced is speci ed, suband superscripts and multiple fonts are enabled (see enhanced text (p. 23) for details). Font names for the core PostScript fonts may be abbreviated to a single letter (T/H/C/S for Times/Helvetica/Courier/Symbol).

If title is speci ed, it will be used as the title of the plot window. It will also be used as the name of the server instance, and will override the optional numerical argument.

Linewidths may be changed with set linestyle.

Png

Syntax:

set terminal png {{no}enhanced}

{{no}transparent} {{no}interlace} {{no}truecolor} {rounded|butt} {linewidth <lw>} {dashlength <dl>} {tiny | small | medium | large | giant}

{font "<face> {,<pointsize>}"} {fontscale <scale>} {size <x>,<y>} {{no}crop}

{background <rgb_color>}

PNG, JPEG and GIF images are created using the external library libgd. PNG plots may be viewed interactively by piping the output to the 'display' program from the ImageMagick package as follows:

set term png

set output '| display png:-'

You can view the output from successive plot commands interactively by typing <space> in the display window. To save the current plot to a le, left click in the display window and choose save.

transparent instructs the driver to make the background color transparent. Default is notransparent.

interlace instructs the driver to generate interlaced PNGs. Default is nointerlace.

The linewidth and dashlength options are scaling factors that a ect all lines drawn, i.e. they are multiplied by values requested in various drawing commands.

By default output png images use 256 indexed colors. The truecolor option instead creates TrueColor images with 24 bits of color information per pixel. Transparent ll styles require the truecolor option. Seellstyle (p. 147). A transparent background is possible in either indexed or TrueColor images.

butt instructs the driver to use a line drawing method that does not overshoot the desired end point of a line. This setting is only applicable for line widths greater than 1. This setting is most useful when drawing horizontal or vertical lines. Default is rounded.

The details of font selection are complicated. Two equivalent simple examples are given below: set term png font arial 11

set term png font "arial,11"

For more information please see the separate section under fonts (p. 31).

The output plot size <x,y> is given in pixels | it defaults to 640x480. Please see additional information under canvas (p. 21) and set size (p. 144). Blank space at the edges of the nished plot may be trimmed using the crop option, resulting in a smaller nal image size. Default is nocrop.

Соседние файлы в папке Books