01.02.2014 Views

GNUPlot Manual

GNUPlot Manual

GNUPlot Manual

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.

46 gnuplot 4.0 28 PLOT<br />

28.4 Parametric<br />

When in parametric mode (set parametric) mathematical expressions must be given in pairs for plot<br />

and in triplets for splot.<br />

Examples:<br />

plot sin(t),t**2<br />

splot cos(u)*cos(v),cos(u)*sin(v),sin(u)<br />

Data files are plotted as before, except any preceding parametric function must be fully specified before<br />

a data file is given as a plot. In other words, the x parametric function (sin(t) above) and the y<br />

parametric function (t**2 above) must not be interrupted with any modifiers or data functions; doing<br />

so will generate a syntax error stating that the parametric function is not fully specified.<br />

Other modifiers, such as with and title, may be specified only after the parametric function has been<br />

completed:<br />

See also<br />

plot sin(t),t**2 title ’Parametric example’ with linespoints<br />

Parametric Mode Demos.<br />

28.5 Ranges<br />

The optional ranges specify the region of the graph that will be displayed.<br />

Syntax:<br />

[{=}{{}:{}}]<br />

[{{}:{}}]<br />

The first form applies to the independent variable (xrange or trange, if in parametric mode). The second<br />

form applies to the dependent variable yrange (and xrange, too, if in parametric mode). <br />

is a new name for the independent variable. (The defaults may be changed with set dummy.)<br />

The optional and terms can be constant expressions or *.<br />

In non-parametric mode, the order in which ranges must be given is xrange and yrange.<br />

In parametric mode, the order for the plot command is trange, xrange, and yrange. The following<br />

plot command shows setting the trange to [-pi:pi], the xrange to [-1.3:1.3] and the yrange to [-1:1]<br />

for the duration of the graph:<br />

plot [-pi:pi] [-1.3:1.3] [-1:1] sin(t),t**2<br />

Note that the x2range and y2range cannot be specified here — set x2range and set y2range must be<br />

used.<br />

Ranges are interpreted in the order listed above for the appropriate mode. Once all those needed are<br />

specified, no further ones must be listed, but unneeded ones cannot be skipped — use an empty range<br />

[] as a placeholder.<br />

* can be used to allow autoscaling of either of min and max. See also set autoscale (p. 54).<br />

Ranges specified on the plot or splot command line affect only that graph; use the set xrange, set<br />

yrange, etc., commands to change the default ranges for future graphs.<br />

With time data, you must provide the range (in the same manner as the time appears in the datafile)<br />

within quotes. gnuplot uses the timefmt string to read the value — see set timefmt (p. 143).<br />

Examples:<br />

This uses the current ranges:<br />

plot cos(x)<br />

This sets the x range only:<br />

plot [-10:30] sin(pi*x)/(pi*x)

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

Saved successfully!

Ooh no, something went wrong!