Ranges

The optional ranges specify the region of the plot that will be displayed.

Syntax:

        [{<dummy-var> =} {<xmin>} { : <xmax>}] { [{<ymin>} {: <ymax>}] }

where <dummy-var> is the independent variable (the defaults are x and y, but these may be changed with set dummy) and the min and max terms can be constant expressions.

* can be used to allow autoscaling of either of min and max. See also set autoscaling

Ranges specified on the plot or splot command line affect only that plot; use the set xrange, set yrange, etc., commands to change the default ranges for future plots.

With time data, you must provide the range (in the same manner as the time appears in the datafile) within quotes. gnuplot uses the timefmt string to read the value—see set timefmt.

Examples:

This uses the current ranges:

        plot cos(x)

This sets the x range only:

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

This is the same, but uses t as the dummy-variable:

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

This sets both the x and y ranges:

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

This sets only the y range, and turns off autoscaling on both axes:

        plot [ ] [-2:sin(5)*-8] sin(x)**besj0(x)

This sets xmax and ymin only:

        plot [:200] [-pi:]  exp(sin(x))

This sets the x, y, and z ranges:

        splot [0:3] [1:4] [-1:1] x*y

This sets the x range for a timeseries (timefmt=''%d/%m/%y %H:%M''):

        plot ["1/6/93 12:00":"5/6/93 12:00"] 'timedata.dat'