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.

78 <strong>gnuplot</strong> 4.3 60 PLOT<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. 87).<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. <strong>gnuplot</strong> uses the timefmt string to read the value — see set timefmt (p. 137).<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)<br />

This is the same, but uses t as the dummy-variable:<br />

plot [t = -10 :30] sin(pi*t)/(pi*t)<br />

This sets both the x and y ranges:<br />

plot [-pi:pi] [-3:3] tan(x), 1/x<br />

This sets only the y range, and turns off autoscaling on both axes:<br />

plot [ ] [-2:sin(5)*-8] sin(x)**besj0(x)<br />

This sets xmax and ymin only:<br />

plot [:200] [-pi:] exp(sin(x))<br />

This sets the x range for a timeseries:<br />

set timefmt "%d/%m/%y %H:%M"<br />

plot ["1/6/93 12:00":"5/6/93 12:00"] ’timedata.dat’<br />

60.7 Iteration<br />

If many similar files or functions are to be plotted together, it may be convenient to do so by iterating<br />

over a shared plot command.<br />

Syntax:<br />

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

splot for [=:{:}]

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

Saved successfully!

Ooh no, something went wrong!