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

104

gnuplot 4.6

set cntrparam levels incremental 100,50

See also set contour (p. 105) for control of where the contours are drawn, and set clabel (p. 101) for control of the format of the contour labels and linetypes.

See also

contours demo (contours.dem)

and

contours with user defined levels demo (discrete.dem).

Color box

The color scheme, i.e. the gradient of the smooth color with min z and max z values of pm3d's palette, is drawn in a color box unless unset colorbox.

set colorbox set colorbox {

{vertical | horizontal }

{default | user }

{origin x, y }

{size x, y }

{front | back }

{noborder | bdefault | border [line style] }

}

show colorbox unset colorbox

Color box position can be default or user. If the latter is speci ed the values as given with the origin and size subcommands are used. The box can be drawn after (front) or before (back) the graph or the surface.

The orientation of the color gradient can be switched by options vertical and horizontal.

origin x, y and size x, y are used only in combination with the user option. The x and y values are interpreted as screen coordinates by default, and this is the only legal option for 3D plots. 2D plots, including splot with set view map, allow any coordinate system to be speci ed. Try for example:

set colorbox horiz user origin .1,.02 size .8,.04

which will draw a horizontal gradient somewhere at the bottom of the graph.

border turns the border on (this is the default). noborder turns the border o . If an positive integer argument is given after border, it is used as a line style tag which is used for drawing the border, e.g.:

set style line 2604 linetype -1 linewidth .4 set colorbox border 2604

will use line style 2604, a thin line with the default border color (-1) for drawing the border. bdefault (which is the default) will use the default border line style for drawing the border of the color box.

The axis of the color box is called cb and it is controlled by means of the usual axes commands, i.e. set/unset/show with cbrange, [m]cbtics, format cb, grid [m]cb, cblabel, and perhaps even cbdata, [no]cbdtics, [no]cbmtics.

set colorbox without any parameter switches the position to default. unset colorbox resets the default parameters for the colorbox and switches the colorbox o .

See also help for set pm3d (p. 134), set palette (p. 137), x11 pm3d (p. 230), and set style line (p. 149).

Colornames

Gnuplot knows a limited number of color names. You can use these to de ne the color range spanned by a pm3d palette, or to assign a terminal-independent color to a particular linetype or linestyle. To see the list of known color names, use the command show colornames (p. 104). Example:

gnuplot 4.6

105

set style line 1 linecolor rgb "sea-green"

Contour

set contour enables contour drawing for surfaces. This option is available for splot only. It requires grid data, see grid data (p. 170) for more details. If contours are desired from non-grid data, set dgrid3d can be used to create an appropriate grid.

Syntax:

set contour {base | surface | both} unset contour

show contour

The three options specify where to draw the contours: base draws the contours on the grid base where the x/ytics are placed, surface draws the contours on the surfaces themselves, and both draws the contours on both the base and the surface. If no option is provided, the default is base.

See also set cntrparam (p. 102) for the parameters that a ect the drawing of contours, and set clabel (p. 101) for control of labelling of the contours.

The surface can be switched o (see set surface (p. 151)), giving a contour-only graph. Though it is possible to use set size to enlarge the plot to ll the screen, more control over the output format can be obtained by writing the contour information to a le, and rereading it as a 2D data le plot:

unset surface set contour

set cntrparam ...

set table 'filename' splot ...

unset table

# contour info now in filename set term <whatever>

plot 'filename'

In order to draw contours, the data should be organized as "grid data". In such a le all the points for a single y-isoline are listed, then all the points for the next y-isoline, and so on. A single blank line (a line containing no characters other than blank spaces and a carriage return and/or a line feed) separates one y-isoline from the next. See also splot data le (p. 168).

See also

contours demo (contours.dem)

and

contours with user defined levels demo (discrete.dem).

Data style

This form of the command is deprecated. Please see set style data (p. 147).

Data le

The set data le command options control interpretation of elds read from input data les by the plot, splot, and t commands. Six such options are currently implemented.

Set data le fortran

The set data le fortran command enables a special check for values in the input le expressed as Fortran D or Q constants. This extra check slows down the input process, and should only be selected if you do

106

gnuplot 4.6

in fact have data les containing Fortran D or Q constants. The option can be disabled again using unset data le fortran.

Set data le nofpe trap

The set data le nofpe trap command tells gnuplot not to re-initialize a oating point exception handler before every expression evaluation used while reading data from an input le. This can signi cantly speed data input from very large les at the risk of program termination if a oating-point exception is generated.

Set data le missing

The set data le missing command allows you to tell gnuplot what character string is used in a data le to denote missing data. Exactly how this missing value will be treated depends on the using speci er of the plot or splot command.

Syntax:

set datafile missing {"<string>"} show datafile missing

unset datafile

Example:

# Ignore entries containing IEEE NaN ("Not a Number") code set datafile missing "NaN"

Example:

set style data linespoints plot '-'

1 10

2 20

3 ?

4 40

5 50 e

set datafile missing "?" plot '-'

1 10

2 20

3 ?

4 40

5 50 e

plot '-' using 1:2 1 10 2 20 3 ?

4 40

5 50 e

plot '-' using 1:($2) 1 10 2 20 3 ?

4 40

5 50 e

gnuplot 4.6

107

The rst plot will recognize only the rst datum in the "3 ?" line. It will use the single-datum-on-a-line convention that the line number is "x" and the datum is "y", so the point will be plotted (in this case erroneously) at (2,3).

The second and third plot commands will correctly ignore the middle line. The plotted line will connect the points at (2,20) and (4,40).

The fourth plot will also correctly ignore the middle line, but the plotted line will not connect the points at (2,20) and (4,40).

There is no default character for missing, but in many cases any non-parsible string of characters found where a numerical value is expected will be treated as missing data.

Set data le separator

The command set data le separator "<char>" tells gnuplot that data elds in subsequent input les are separated by <char> rather than by whitespace. The most common use is to read in csv (comma-separated value) les written by spreadsheet or database programs. By default data elds are separated by whitespace.

Syntax:

set datafile separator {"<char>" | whitespace}

Examples:

#Input file contains tab-separated fields set datafile separator "\t"

#Input file contains comma-separated values fields set datafile separator ","

Set data le commentschars

The set data le commentschars command allows you to tell gnuplot what characters are used in a datale to denote comments. Gnuplot will ignore rest of the line behind the speci ed characters if either of them is the rst non-blank character on the line.

Syntax:

set datafile commentschars {"<string>"} show datafile commentschars

unset commentschars

Default value of the string is "#!" on VMS and "#" otherwise.

Then, the following line in a data le is completely ignored

# 1 2 3 4

but the following

1 # 3 4

produces rather unexpected plot unless

set datafile missing '#'

is speci ed as well.

Example:

set datafile commentschars "#!%"

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