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

gnuplot 4.6

127

Mouseformat

The set mouse format command speci es a format string for sprintf() which determines how the mouse cursor [x,y] coordinates are printed to the plot window and to the clipboard. The default is "% #g".

set mouse clipboardformat and set mouse mouseformat are used for formatting the text on Button1 and Button2 actions { copying the coordinates to the clipboard and temporarily annotating the mouse position. An integer argument selects one of the format options in the table below. A string argument is used as a format for sprintf() in option 6 and should contain two oat speci ers. Example:

`set mouse mouseformat "mouse x,y = %5.2g, %10.3f"`.

Use set mouse mouseformat "" to turn this string o again.

The following formats are available:

0default (same as 1)

1

axis coordinates

 

1.23, 2.45

 

 

2

graph coordinates (from 0 to 1)

/0.00, 1.00/

 

 

3

x = timefmt

y = axis

[(as set by `set timefmt`), 2.45]

4

x = date

y = axis

[31. 12. 1999, 2.45]

 

5

x = time

y = axis

[23:59, 2.45]

 

 

6

x = date time

y = axis

[31. 12. 1999

23:59, 2.45]

 

7

format from `set mouse mouseformat`, e.g. "mouse

x,y = 1.23,

2.450"

Scrolling

X and Y axis scaling in both 2D and 3D graphs can be adjusted using the mouse wheel. <wheel-up> scrolls up (increases both YMIN and YMAX by ten percent of the Y range, and increases both Y2MIN and Y2MAX likewise), and <wheel down> scrolls down. <shift-wheel-up> scrolls left (decreases both XMIN and XMAX, and both X2MIN and X2MAX), and <shift-wheel-down> scrolls right. <control-wheel-up> zooms in toward the center of the plot, and <control-wheel-down> zooms out. <shift-control-wheel-up> zooms in along the X and X2 axes only, and <shift-control-wheel-down> zooms out along the X and X2 axes only.

X11 mouse

If multiple X11 plot windows have been opened using the set term x11 <n> terminal option, then only the current plot window supports the entire range of mouse commands and hotkeys. The other windows will, however, continue to display mouse coordinates at the lower left.

Zoom

Zooming is usually accomplished by holding down the left mouse button and dragging the mouse to delineate a zoom region. Some platforms may require using a di erent mouse button. The original plot can be restored by typing the 'u' hotkey in the plot window. The hotkeys 'p' and 'n' step back and forth through a history of zoom operations.

The option zoomcoordinates determines if the coordinates of the zoom box are drawn at the edges while zooming. This is on by default.

If the option zoomjump is on, the mouse pointer will be automatically o set a small distance after starting a zoom region with button 3. This can be useful to avoid a tiny (or even empty) zoom region. zoomjump is o by default.

Multiplot

The command set multiplot places gnuplot in the multiplot mode, in which several plots are placed on the same page, window, or screen.

Syntax:

128

gnuplot 4.6

set multiplot { layout <rows>,<cols> {rowsfirst|columnsfirst} {downwards|upwards} {title <page title>}

{scale <xscale>{,<yscale>}} {offset <xoff>{,<yoff>}}

}

unset multiplot

For some terminals, no plot is displayed until the command unset multiplot is given, which causes the entire page to be drawn and then returns gnuplot to its normal single-plot mode. For other terminals, each separate plot command produces an updated display, either by redrawing all previous ones and the newly added plot, or by just adding the new plot to the existing display.

The area to be used by the next plot is not erased before doing the new plot. The clear command can be used to do this if wanted, as is typically the case for "inset" plots.

Any labels or arrows that have been de ned will be drawn for each plot according to the current size and origin (unless their coordinates are de ned in the screen system). Just about everything else that can be set is applied to each plot, too. If you want something to appear only once on the page, for instance a single time stamp, you'll need to put a set time/unset time pair around one of the plot, splot or replot commands within the set multiplot/unset multiplot block.

The multiplot title is separate from the individual plot titles, if any. Space is reserved for it at the top of the page, spanning the full width of the canvas.

The commands set origin and set size must be used to correctly position each plot if no layout is speci ed or if ne tuning is desired. See set origin (p. 132) and set size (p. 144) for details of their usage.

Example:

set multiplot set size 0.4,0.4

set origin 0.1,0.1 plot sin(x)

set size 0.2,0.2 set origin 0.5,0.5 plot cos(x)

unset multiplot

This displays a plot of cos(x) stacked above a plot of sin(x).

set size and set origin refer to the entire plotting area used for each plot. Please also see set term size (p. 21). If you want to have the axes themselves line up, you can guarantee that the margins are the same size with the set margin commands. See set margin (p. 125) for their use. Note that the margin settings are absolute, in character units, so the appearance of the graph in the remaining space will depend on the screen size of the display device, e.g., perhaps quite di erent on a video display and a printer.

With the layout option you can generate simple multiplots without having to give the set size and set origin commands before each plot: Those are generated automatically, but can be overridden at any time. With layout the display will be divided by a grid with <rows> rows and <cols> columns. This grid islled rows rst or columns rst depending on whether the corresponding option is given in the multiplot command. The stack of plots can grow downwards or upwards. Default is rows rst and downwards.

Each plot can be scaled by scale and shifted with o set; if the y-values for scale or o set are omitted, the x-value will be used. unset multiplot will turn o the automatic layout and restore the values of set size and set origin as they were before set multiplot layout.

Example:

set size 1,1 set origin 0,0

set multiplot layout 3,2 columnsfirst scale 1.1,0.9 [ up to 6 plot commands here ]

unset multiplot

The above example will produce 6 plots in 2 columns lled top to bottom, left to right. Each plot will have a horizontal size of 1.1/2 and a vertical size of 0.9/3.

gnuplot 4.6

129

See also

multiplot demo (multiplt.dem)

Mx2tics

Minor tic marks along the x2 (top) axis are controlled by set mx2tics. Please see set mxtics (p. 129).

Mxtics

Minor tic marks along the x axis are controlled by set mxtics. They can be turned o with unset mxtics. Similar commands control minor tics along the other axes.

Syntax:

set mxtics {<freq> | default} unset mxtics

show mxtics

The same syntax applies to mytics, mztics, mx2tics, my2tics and mcbtics.

<freq> is the number of sub-intervals (NOT the number of minor tics) between major tics (the default for a linear axis is either two or ve depending on the major tics, so there are one or four minor tics between major tics). Selecting default will return the number of minor ticks to its default value.

If the axis is logarithmic, the number of sub-intervals will be set to a reasonable number by default (based upon the length of a decade). This will be overridden if <freq> is given. However the usual minor tics (2, 3, ..., 8, 9 between 1 and 10, for example) are obtained by setting <freq> to 10, even though there are but nine sub-intervals.

To set minor tics at arbitrary positions, use the ("<label>" <pos> <level>, ...) form of set fxjx2jyjy2jzgtics with <label> empty and <level> set to 1.

The set mfxjx2jyjy2jzgtics commands work only when there are uniformly spaced major tics. If all major tics were placed explicitly by set fxjx2jyjy2jzgtics, then minor tic commands are ignored. Implicit major tics and explicit minor tics can be combined using set fxjx2jyjy2jzgtics and set fxjx2jyjy2jzgtics add.

Examples:

set xtics 0, 5, 10 set xtics add (7.5) set mxtics 5

Major tics at 0,5,7.5,10, minor tics at 1,2,3,4,6,7,8,9

set logscale y

set ytics format "" set ytics 1e-6, 10, 1

set ytics add ("1" 1, ".1" 0.1, ".01" 0.01, "10^-3" 0.001, \ "10^-4" 0.0001)

set mytics 10

Major tics with special formatting, minor tics at log positions

By default, minor tics are o for linear axes and on for logarithmic axes. They inherit the settings for axisjborder and fnogmirror speci ed for the major tics. Please see set xtics (p. 160) for information about these.

My2tics

Minor tic marks along the y2 (right-hand) axis are controlled by set my2tics. Please see set mxtics (p. 129).

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