Ranges may be provided on the plot and splot command line and affect only that plot, or in the set xrange, set yrange, etc., commands, to change the default ranges for future plots.
Syntax:
[{<dummy-var> =} {<xmin> : <xmax>}] { [{<ymin> : <ymax>}] }
where <dummy-var> is the independent variable (the defaults are x and y, but this may be changed with set dummy) and the min and max terms can be constant expressions.
Both the min and max terms are optional. The ':' is also optional if neither a min nor a max term is specified. This allows '[ ]' to be used as a null range specification.
Specifying a range in the plot command line turns autoscaling for that axis off for that plot. Using one of the set range commands turns autoscaling off for that axis for future plots, unless changed later. (See set autoscale).
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