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

218

gnuplot 4.6

SVG allows you to embed fonts directly into an SVG document, or to provide a hypertext link to the desired font. The font le option speci es a local le which is copied into the <defs> section of the resulting SVG output le. This le may either itself contain a font, or may contain the records necessary to create a hypertext reference to the desired font. Gnuplot will look for the requested le using the directory list in the GNUPLOT FONTPATH environmental variable. NB: You must embed an svg font, not a TrueType or PostScript font.

Svga

The svga terminal driver supports PCs with SVGA graphics. It can only be used if it is compiled with DJGPP. Its only option is the font.

Syntax:

set terminal svga {"<fontname>"}

Tek40

This family of terminal drivers supports a variety of VT-like terminals. tek40xx supports Tektronix 4010 and others as well as most TEK emulators. vttek supports VT-like tek40xx terminal emulators. The following are present only if selected when gnuplot is built: kc-tek40xx supports MS-DOS Kermit Tek4010 terminal emulators in color; km-tek40xx supports them in monochrome. selanar supports Selanar graphics. bitgraph supports BBN Bitgraph terminals. None have any options.

Tek410x

The tek410x terminal driver supports the 410x and 420x family of Tektronix terminals. It has no options.

Texdraw

The texdraw terminal driver supports the LaTeX texdraw environment. It is intended for use with "texdraw.sty" and "texdraw.tex" in the texdraw package.

Points, among other things, are drawn using the LaTeX commands "nDiamond" and "nBox". These commands no longer belong to the LaTeX2e core; they are included in the latexsym package, which is part of the base distribution and thus part of any LaTeX implementation. Please do not forget to use this package.

It has no options.

Tgif

Tgif is an X11-based drawing tool | it has nothing to do with GIF.

The tgif driver supports di erent pointsizes (with set pointsize), di erent label fonts and font sizes (e.g. set label "Hallo" at x,y font "Helvetica,34") and multiple graphs on the page. The proportions of the axes are not changed.

Syntax:

set terminal tgif {portrait | landscape | default} {<[x,y]>} {monochrome | color}

{{linewidth | lw} <LW>} {solid | dashed}

{font "<fontname>{,<fontsize>}"}

where <[x,y]> speci es the number of graphs in the x and y directions on the page, color enables color, linewidth scales all linewidths by <LW>, "<fontname>" is the name of a valid PostScript font, and <fontsize> speci es the size of the PostScript font. defaults sets all options to their defaults: portrait,

[1,1], color, linwidth 1.0, dashed, "Helvetica,18".

gnuplot 4.6

219

The solid option is usually prefered if lines are colored, as they often are in the editor. Hardcopy will be black-and-white, so dashed should be chosen for that.

Multiplot is implemented in two di erent ways.

The rst multiplot implementation is the standard gnuplot multiplot feature:

set terminal tgif set output "file.obj" set multiplot

set origin x01,y01 set size xs,ys plot ...

...

set origin x02,y02 plot ...

unset multiplot

See set multiplot (p. 127) for further information.

The second version is the [x,y] option for the driver itself. The advantage of this implementation is that everything is scaled and placed automatically without the need for setting origins and sizes; the graphs keep their natural x/y proportions of 3/2 (or whatever is xed by set size).

If both multiplot methods are selected, the standard method is chosen and a warning message is given.

Examples of single plots (or standard multiplot):

set terminal tgif

# defaults

set terminal tgif "Times-Roman,24"

 

set terminal tgif landscape

 

set terminal tgif landscape solid

 

Examples using the built-in multiplot mechanism:

set terminal tgif portrait [2,4]

#

portrait; 2 plots in the x-

 

#

and 4 in the

y-direction

set terminal tgif [1,2]

#

portrait; 1 plot in the x-

 

#

and 2 in the

y-direction

set terminal tgif landscape [3,3] #

landscape; 3

plots in both

 

#

directions

 

Tikz

This driver creates output for use with the TikZ package of graphics macros in TeX. It is currently implemented via an external lua script, and set term tikz is a short form of the command set term lua tikz. See term lua (p. 198) for more information. Use the command set term tikz help to print terminal options.

Tkcanvas

This terminal driver generates Tk canvas widget commands based on Tcl/Tk (default) or Perl. To use it, rebuild gnuplot (after uncommenting or inserting the appropriate line in "term.h"), then

gnuplot> set term tkcanvas {perltk} {interactive} gnuplot> set output 'plot.file'

After invoking "wish", execute the following sequence of Tcl/Tk commands:

%source plot.file

%canvas .c

%pack .c

%gnuplot .c

220

gnuplot 4.6

Or, for Perl/Tk use a program like this:

use Tk;

my $top = MainWindow->new; my $c = $top->Canvas->pack; my $gnuplot = do "plot.pl"; $gnuplot->($c);

MainLoop;

The code generated by gnuplot creates a procedure called "gnuplot" that takes the name of a canvas as its argument. When the procedure is called, it clears the canvas, nds the size of the canvas and draws the plot in it, scaled to t.

For 2-dimensional plotting (plot) two additional procedures are de ned: "gnuplot plotarea" will return a list containing the borders of the plotting area "xleft, xright, ytop, ybot" in canvas screen coordinates, while the ranges of the two axes "x1min, x1max, y1min, y1max, x2min, x2max, y2min, y2max" in plot coordinates can be obtained calling "gnuplot axisranges". If the "interactive" option is speci ed, mouse clicking on a line segment will print the coordinates of its midpoint to stdout. Advanced actions can happen instead if the user supplies a procedure named "user gnuplot coordinates", which takes the following arguments: "win id x1s y1s x2s y2s x1e y1e x2e y2e x1m y1m x2m y2m", the name of the canvas and the id of the line segment followed by the coordinates of its start and end point in the two possible axis ranges; the coordinates of the midpoint are only lled for logarithmic axes.

The current version of tkcanvas supports neither multiplot nor replot.

Tpic

The tpic terminal driver supports the LaTeX picture environment with tpic nspecials. It is an alternative to the latex and eepic terminal drivers. Options are the point size, line width, and dot-dash interval.

Syntax:

set terminal tpic <pointsize> <linewidth> <interval>

where pointsize and linewidth are integers in milli-inches and interval is a oat in inches. If a non-positive value is speci ed, the default is chosen: pointsize = 40, linewidth = 6, interval = 0.1.

All drivers for LaTeX o er a special way of controlling text positioning: If any text string begins with 'f', you also need to include a 'g' at the end of the text, and the whole text will be centered both horizontally and vertically by LaTeX. | If the text string begins with '[', you need to continue it with: a position speci cation (up to two out of t,b,l,r), ']f', the text itself, and nally, 'g'. The text itself may be anything LaTeX can typeset as an LR-box. nrulefgfg's may help for best positioning.

Examples: 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}}'

Vgagl

The vgagl driver is a fast linux console driver with full mouse and pm3d support. It looks at the environment variable SVGALIB DEFAULT MODE for the default mode; if not set, it uses a 256 color mode with the highest available resolution.

Syntax:

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