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

gnuplot 4.6

75

Furthermore, similar to the using speci cation, the format can include discarded columns via the * character and have implicit repetition via a numerical repeateld. For example, format="%*2int%3 oat" causes gnuplot to discard two ints before reading three oats. To list variable sizes, type show data le binary datasizes. There are a group of names that are machine dependent along with their sizes in bytes for the particular compilation. There is also a group of names which attempt to be machine independent.

Endian

Often the endianess of binary data in the le does not agree with the endianess used by the platform on which gnuplot is running. Several words can direct gnuplot how to arrange bytes. For example endian=little means treat the binary le as having byte signi cance from least to greatest. The options are

little: least significant to greatest significance big: greatest significance to least significance

default: assume file endianess is the same as compiler swap (swab): Interchange the significance. (If things

don't look right, try this.)

Gnuplot can support "middle" ("pdp") endian if it is compiled with that option.

Filetype

For some standard binary le formats gnuplot can extract all the necessary information from the le in question. As an example, "format=edf" will read ESRF Header File format les. For a list of the currently supported le formats, type show data le binary letypes.

There is a special le type called auto for which gnuplot will check if the binary le's extension is a quasistandard extension for a supported format.

Command line keywords may be used to override settings extracted from the le. The settings from the le override any defaults. (See set data le binary (p. 108) for details.)

Avs avs is one of the automatically recognized binary le types for images. AVS is an extremely simple format, suitable mostly for streaming between applications. It consists of 2 longs (xwidth, ywidth) followed by a stream of pixels, each with four bytes of information alpha/red/green/blue.

Edf edf is one of the automatically recognized binary le types for images. EDF stands for ESRF Data Format, and it supports both edf and ehf formats (the latter means ESRF Header Format). More information on speci cations can be found at

http://www.edfplus.info/specs

Png If gnuplot was con gured to use the libgd library for png/gif/jpeg output, then it can also be used to read these same image types as binary les. You can use an explicit command

plot 'file.png' binary filetype=png

Or the le type will be recognized automatically from the extension if you have previously requested

set datafile binary filetype=auto

Keywords

The following keywords apply only when generating coordinates from binary data les. That is, the control mapping the individual elements of a binary array, matrix, or image to speci c x/y/z positions.

76

gnuplot 4.6

Scan A great deal of confusion can arise concerning the relationship between how gnuplot scans a binary le and the dimensions seen on the plot. To lessen the confusion, conceptually think of gnuplot always scanning the binary le point/line/plane or fast/medium/slow. Then this keyword is used to tell gnuplot how to map this scanning convention to the Cartesian convention shown in plots, i.e., x/y/z. The quali er for scan is a two or three letter code representing where point is assigned ( rst letter), line is assigned (second letter), and plane is assigned (third letter). For example, scan=yx means the fastest, point-by-point, increment should be mapped along the Cartesian y dimension and the middle, line-by-line, increment should be mapped along the x dimension.

When the plotting mode is plot, the quali er code can include the two letters x and y. For splot, it can include the three letters x, y and z.

There is nothing restricting the inherent mapping from point/line/plane to apply only to Cartesian coordinates. For this reason there are cylindrical coordinate synonyms for the quali er codes where t (theta), r and z are analogous to the x, y and z of Cartesian coordinates.

Transpose Shorthand notation for scan=yx or scan=yxz.

Dx, dy, dz When gnuplot generates coordinates, it uses the spacing described by these keywords. For example dx=10 dy=20 would mean space samples along the x dimension by 10 and space samples along the y dimension by 20. dy cannot appear if dx does not appear. Similarly, dz cannot appear if dy does not appear. If the underlying dimensions are greater than the keywords speci ed, the spacing of the highest dimension given is extended to the other dimensions. For example, if an image is being read from a le and only dx=3.5 is given gnuplot uses a delta x and delta y of 3.5.

The following keywords also apply only when generating coordinates. However they may also be used with matrix binary les.

Flipx, ipy, ipz Sometimes the scanning directions in a binary data le are not consistent with that assumed by gnuplot. These keywords can ip the scanning direction along dimensions x, y, z.

Origin When gnuplot generates coordinates based upon transposition and ip, it attempts to always position the lower left point in the array at the origin, i.e., the data lies in the rst quadrant of a Cartesian system after transpose and ip.

To position the array somewhere else on the graph, the origin keyword directs gnuplot to position the lower left point of the array at a point speci ed by a tuple. The tuple should be a double for plot and a triple for splot. For example, origin=(100,100):(100,200) is for two records in the le and intended for plotting in two dimensions. A second example, origin=(0,0,3.5), is for plotting in three dimensions.

Center Similar to origin, this keyword will position the array such that its center lies at the point given by the tuple. For example, center=(0,0). Center does not apply when the size of the array is Inf.

Rotate The transpose and ip commands provide some exibility in generating and orienting coordinates. However, for full degrees of freedom, it is possible to apply a rotational vector described by a rotational angle in two dimensions.

The rotate keyword applies to the two-dimensional plane, whether it be plot or splot. The rotation is done with respect to the positive angle of the Cartesian plane.

The angle can be expressed in radians, radians as a multiple of pi, or degrees. For example, rotate=1.5708, rotate=0.5pi and rotate=90deg are equivalent.

If origin is speci ed, the rotation is done about the lower left sample point before translation. Otherwise, the rotation is done about the array center.

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