14.10.2014 Views

gnuplot documentation

gnuplot documentation

gnuplot documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

60 PLOT <strong>gnuplot</strong> 4.3 69<br />

60.2.2.6.4 Flipx, flipy, flipz Sometimes the scanning directions in a binary datafile are not consistent<br />

with that assumed by <strong>gnuplot</strong>. These keywords can flip the scanning direction along dimensions x,<br />

y, z.<br />

60.2.2.6.5 Origin When <strong>gnuplot</strong> generates coordinates based upon transposition and flip, it attempts<br />

to always position the lower left point in the array at the origin, i.e., the data lies in the first<br />

quadrant of a Cartesian system after transpose and flip.<br />

To position the array somewhere else on the graph, the origin keyword directs <strong>gnuplot</strong> to position the<br />

lower left point of the array at a point specified by a tuple. The tuple should be a double for plot and a<br />

triple for splot. For example, origin=(100,100):(100,200) is for two records in the file and intended<br />

for plotting in two dimensions. A second example, origin=(0,0,3.5), is for plotting in three dimensions.<br />

60.2.2.6.6 Center Similar to origin, this keyword will position the array such that its center lies<br />

at the point given by the tuple. For example, center=(0,0). Center does not apply when the size of<br />

the array is Inf.<br />

60.2.2.6.7 Rotate The transpose and flip commands provide some flexibility in generating and<br />

orienting coordinates. However, for full degrees of freedom, it is possible to apply a rotational vector<br />

described by a rotational angle in two dimensions.<br />

The rotate keyword applies to the two-dimensional plane, whether it be plot or splot. The rotation is<br />

done with respect to the positive angle of the Cartesian plane.<br />

For example, ro-<br />

The angle can be expressed in radians, radians as a multiple of pi, or degrees.<br />

tate=1.5708, rotate=0.5pi and rotate=90deg are equivalent.<br />

If origin is specified, the rotation is done about the lower left sample point before translation. Otherwise,<br />

the rotation is done about the array center.<br />

60.2.2.6.8 Perpendicular For splot, the concept of a rotational vector is implemented by a triple<br />

representing the vector to be oriented normal to the two-dimensional x-y plane. Naturally, the default<br />

is (0,0,1). Thus specifying both rotate and perpendicular together can orient data myriad ways in<br />

three-space.<br />

The two-dimensional rotation is done first, followed by the three-dimensional rotation. That is, if R’<br />

is the rotational 2 x 2 matrix described by an angle, and P is the 3 x 3 matrix projecting (0,0,1)<br />

to (xp,yp,zp), let R be constructed from R’ at the upper left sub-matrix, 1 at element 3,3 and zeros<br />

elsewhere. Then the matrix formula for translating data is v’ = P R v, where v is the 3 x 1 vector of<br />

data extracted from the data file. In cases where the data of the file is inherently not three-dimensional,<br />

logical rules are used to place the data in three-space. (E.g., usually setting the z-dimension value to<br />

zero and placing 2D data in the x-y plane.)<br />

60.2.2.7 Binary examples Examples:<br />

# Selects two float values (second one implicit) with a float value<br />

# discarded between them for an indefinite length of 1D data.<br />

plot ’’ binary format="%float%*float" using 1:2 with lines<br />

# The data file header contains all details necessary for creating<br />

# coordinates from an EDF file.<br />

plot ’’ binary filetype=edf with image<br />

plot ’.edf’ binary filetype=auto with image<br />

# Selects three unsigned characters for components of a raw RGB image<br />

# and flips the y-dimension so that typical image orientation (start<br />

# at top left corner) translates to the Cartesian plane. Pixel<br />

# spacing is given and there are two images in the file. One of them

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!