14.10.2014 Views

gnuplot documentation

gnuplot documentation

gnuplot documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

98 <strong>gnuplot</strong> 4.3 70 SET-SHOW<br />

set dgrid3d {} {,{} {,}}<br />

unset dgrid3d<br />

show dgrid3d<br />

By default dgrid3d is disabled. When enabled, 3D data read from a file are always treated as a scattered<br />

data set. A grid with dimensions derived from a bounding box of the scattered data and size as specified<br />

by the row/col size parameters is created for plotting and contouring. The grid is equally spaced in x<br />

(rows) and in y (columns); the z values are computed as weighted averages of the scattered points’ z<br />

values.<br />

The third parameter, norm, controls the weighting: Each data point is weighted inversely by its distance<br />

from the grid point raised to the norm power. (Actually, the weights are given by the inverse of dx^norm<br />

+ dy^norm, where dx and dy are the components of the separation of the grid point from each data point.<br />

For some norms that are powers of two, specifically 4, 8, and 16, the computation is optimized by using<br />

the Euclidean distance in the weight calculation, (dx^2+dy^2)^norm/2. However, any non-negative<br />

integer can be used.)<br />

The closer the data point is to a grid point, the more effect it has on that grid point and the larger the<br />

value of norm the less effect more distant data points have on that grid point.<br />

The dgrid3d option is a simple low pass filter that converts scattered data to a grid data set. More<br />

sophisticated approaches to this problem exist and should be used to preprocess the data outside <strong>gnuplot</strong><br />

if this simple solution is found inadequate.<br />

(The z values are found by weighting all data points, not by interpolating between nearby data points;<br />

also edge effects may produce unexpected and/or undesired results. In some cases, small norm values<br />

produce a grid point reflecting the average of distant data points rather than a local average, while<br />

large values of norm may produce "steps" with several grid points having the same value as the closest<br />

data point, rather than making a smooth transition between adjacent data points. Some areas of a grid<br />

may be filled by extrapolation, to an arbitrary boundary condition. The variables are not normalized;<br />

consequently the units used for x and y will affect the relative weights of points in the x and y directions.)<br />

Examples:<br />

set dgrid3d 10,10,1<br />

set dgrid3d ,,4<br />

# defaults<br />

The first specifies that a grid of size 10 by 10 is to be constructed using a norm value of 1 in the weight<br />

computation. The second only modifies the norm, changing it to 4. See also<br />

scatter.dem:<br />

dgrid3d demo.<br />

70.17 Dummy<br />

The set dummy command changes the default dummy variable names.<br />

Syntax:<br />

set dummy {} {,}<br />

show dummy<br />

By default, <strong>gnuplot</strong> assumes that the independent, or "dummy", variable for the plot command is<br />

"t" if in parametric or polar mode, or "x" otherwise. Similarly the independent variables for the splot<br />

command are "u" and "v" in parametric mode (splot cannot be used in polar mode), or "x" and "y"<br />

otherwise.<br />

It may be more convenient to call a dummy variable by a more physically meaningful or conventional<br />

name. For example, when plotting time functions:<br />

set dummy t<br />

plot sin(t), cos(t)<br />

At least one dummy variable must be set on the command; set dummy by itself will generate an error<br />

message.<br />

Examples:

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

Saved successfully!

Ooh no, something went wrong!