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

130

gnuplot 4.6

Mytics

Minor tic marks along the y axis are controlled by set mytics. Please see set mxtics (p. 129).

Mztics

Minor tic marks along the z axis are controlled by set mztics. Please see set mxtics (p. 129).

Object

The set object command de nes a single object which will appear in all subsequent 2D plots. You may de ne as many objects as you like. Currently the supported object types are rectangle, circle, ellipse, and polygon. Rectangles inherit a default set of style properties ( ll, color, border) from those set by the command set style rectangle, but each object can also be given individual style properties. Circles, ellipses, and polygons inherit the ll style from set style ll.

Syntax:

set object <index>

<object-type> <object-properties>

{front|back|behind} {fc|fillcolor <colorspec>} {fs <fillstyle>} {default} {lw|linewidth <width>}

<object-type> is either rectangle, ellipse, circle, or polygon. Each object type has its own set of characteristic properties.

Setting front will draw the object in front of all plot elements, but behind any labels that are also marked front. Setting back will place the object behind all plot curves and labels. Setting behind will place the object behind everything including the axes and back rectangles, thus

set object rectangle from screen 0,0 to screen 1,1 behind

can be used to provide a colored background for the entire graph or page.

The ll color of the object is taken from the <colorspec>. llcolor may be abbreviated fc. The ll style is taken from < llstyle>. See colorspec (p. 34) and llstyle (p. 147). If the keyword default is given, these properties are inherited from the default settings at the time a plot is drawn. See set style rectangle (p. 150).

Rectangle

Syntax:

set object <index> rectangle

{from <position> {to|rto} <position> | center <position> size <w>,<h> |

at <position> size <w>,<h>}

The position of the rectangle may be speci ed by giving the position of two diagonal corners (bottom left and top right) or by giving the position of the center followed by the width and the height. In either case the positions may be given in axis, graph, or screen coordinates. See coordinates (p. 22). The options at and center are synonyms.

Examples:

#Force the entire area enclosed by the axes to have background color cyan set object 1 rect from graph 0, graph 0 to graph 1, graph 1 back

set object 1 rect fc rgb "cyan" fillstyle solid 1.0

#Position a red square with lower left at 0,0 and upper right at 2,3

set object 2 rect from 0,0 to 2,3 fc lt 1

gnuplot 4.6

131

#Position an empty rectangle (no fill) with a blue border set object 3 rect from 0,0 to 2,3 fs empty border rgb "blue"

#Return fill and color to the default style but leave vertices unchanged set object 2 rect default

Ellipse

Syntax:

set object <index> ellipse {at|center} <position> size <w>,<h> {angle <orientation>} {units xy|xx|yy} {<other-object-properties>}

The position of the ellipse is speci ed by giving the center followed by the width and the height (actually the major and minor axes). The keywords at and center are synonyms. The center position may be given in axis, graph, or screen coordinates. See coordinates (p. 22). The major and minor axis lengths must be given in axis coordinates. The orientation of the ellipse is speci ed by the angle between the horizontal axis and the major diameter of the ellipse. If no angle is given, the default ellipse orientation will be used instead (see set style ellipse (p. 151)). The units keyword controls the scaling of the axes of the ellipse. units xy means that the major axis is interpreted in terms of units along the x axis, while the minor axis in that of the y axis. units xx means that both axes of the ellipses are scaled in the units of the x axis, while units yy means that both axes are in units of the y axis. The default is xy or whatever set style ellipse units was set to.

NB: If the x and y axis scales are not equal, (e.g. units xy is in e ect) then the major/minor axis ratio will no longer be correct after rotation.

Note that set object ellipse size <2r>,<2r> does not in general produce the same result as set object circle <r>. The circle radius is always interpreted in terms of units along the x axis, and will always produce a circle even if the x and y axis scales are di erent and even if the aspect ratio of your plot is not 1. If units is set to xy, then 'set object ellipse' interprets the rst <2r> in terms of x axis units and the second <2r> in terms of y axis units. This will only produce a circle if the x and y axis scales are identical and the plot aspect ratio is 1. On the other hand, if units is set to xx or yy, then the diameters speci ed in the 'set object' command will be interpreted in the same units, so the ellipse will have the correct aspect ratio, and it will maintain its aspect ratio even if the plot is resized.

Circle

Syntax:

set object <index> circle {at|center} <position> size <radius> {arc [<begin>:<end>]}

{<other-object-properties>}

The position of the circle is speci ed by giving the position of the center center followed by the radius. The keywords at and center are synonyms. The position and radius may be given in x-axis, graph, or canvas coordinates. See coordinates (p. 22). In all cases the radius is calculated relative to the horizontal scale of the axis, graph, or canvas. Any disparity between the horizontal and vertical scaling will be corrected for so that the result is always a circle.

By default a full circle is drawn. The optional quali er arc speci es a starting angle and ending angle, in degrees, for one arc of the circle. The arc is always drawn counterclockwise.

Polygon

Syntax:

set object <index> polygon

from <position> to <position> ... {to <position>}

132

gnuplot 4.6

or

from <position> rto <position> ... {rto <position>}

The position of the polygon may be speci ed by giving the position of a sequence of vertices. These may be given in axis, graph, or screen coordinates. If relative coordinates are used (rto) then the coordinate type must match that of the previous vertex. See coordinates (p. 22).

Example:

set object 1 polygon from 0,0 to 1,1 to 2,0

set object 1 fc rgb "cyan" fillstyle solid 1.0 border lt -1

O sets

O sets provide a mechanism to put an empty boundary around the data inside an autoscaled graph. The o sets only a ect the x1 and y1 axes, and only in 2D plot commands.

Syntax:

set offsets <left>, <right>, <top>, <bottom> unset offsets

show offsets

Each o set may be a constant or an expression. Each defaults to 0. By default, the left and right o sets are given in units of the rst x axis, the top and bottom o sets in units of the rst y axis. Alternatively, you may specify the o sets as a fraction of the total axis range by using the keyword "graph". A positive o set expands the axis range in the speci ed direction, e.g., a positive bottom o set makes ymin more negative. Negative o sets, while permitted, can have unexpected interactions with autoscaling and clipping. To prevent the auto-scaling from further adjusting your axis ranges, it is useful to also specify "set auto x".

Example:

set auto fix

set offsets graph 0.05, 0, 2, 2 plot sin(x)

This graph of sin(x) will have a y range [-3:3] because the function will be autoscaled to [-1:1] and the vertical o sets are each two. The x range will be [-11:10] because the default is [-10:10] and it has been expanded to the left by 0.05 of that total range.

Origin

The set origin command is used to specify the origin of a plotting surface (i.e., the graph and its margins) on the screen. The coordinates are given in the screen coordinate system (see coordinates (p. 22) for information about this system).

Syntax:

set origin <x-origin>,<y-origin>

Output

By default, screens are displayed to the standard output. The set output command redirects the display to the speci ed le or device.

Syntax:

set output {"<filename>"} show output

The lename must be enclosed in quotes. If the lename is omitted, any output le opened by a previous invocation of set output will be closed and new output will be sent to STDOUT. (If you give the command

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