Credits Overview Plotting Styles Commands Terminals

xrange

The set xrange command sets the horizontal range that will be displayed. A similar command exists for each of the other axes, as well as for the polar radius r and the parametric variables t, u, and v.

Syntax:

      set xrange [{{<min>}:{<max>}}] {{no}reverse} {{no}extend}
                 | restore
      show xrange

where <min> and <max> terms are constants, expressions or an asterisk to set autoscaling. If the data are time/date, you must give the range as a quoted string according to the set timefmt format. If <min> or <max> is omitted the current value will not be changed. See below for full autoscaling syntax. See also noextend.

The same syntax applies to yrange, zrange, x2range, y2range, cbrange, rrange, trange, urange and vrange.

See set link for options that link the ranges of x and x2, or y and y2.

The reverse option reverses the direction of an autoscaled axis. For example, if the data values range from 10 to 100, it will autoscale to the equivalent of set xrange [100:10]. The reverse flag has no effect if the axis is not autoscaled.

Autoscaling: If <min> (the same applies for correspondingly to <max>) is an asterisk "*" autoscaling is turned on. The range in which autoscaling is being performed may be limited by a lower bound <lb> or an upper bound <ub> or both. The syntax is

      { <lb> < } * { < <ub> }

For example,

      0 < * < 200

sets <lb> = 0 and <ub> = 200. With such a setting <min> would be autoscaled, but its final value will be between 0 and 200 (both inclusive despite the '<' sign). If no lower or upper bound is specified, the '<' to also be omitted. If <ub> is lower than <lb> the constraints will be turned off and full autoscaling will happen. This feature is useful to plot measured data with autoscaling but providing a limit on the range, to clip outliers, or to guarantee a minimum range that will be displayed even if the data would not need such a big range.

The command set xrange restore overwrites the current range min and max with the values found during the most recent autoscaling operation.

In 2D, xrange and yrange determine the extent of the axes, trange determines the range of the parametric variable in parametric mode or the range of the angle in polar mode. Similarly in parametric 3D, xrange, yrange, and zrange govern the axes and urange and vrange govern the parametric variables.

In polar mode, rrange determines the radial range plotted. <rmin> acts as an additive constant to the radius, whereas <rmax> acts as a clip to the radius---no point with radius greater than <rmax> will be plotted. xrange and yrange are affected---the ranges can be set as if the graph was of r(t)-rmin, with rmin added to all the labels.

Any range may be partially or totally autoscaled, although it may not make sense to autoscale a parametric variable unless it is plotted with data.

Ranges may also be specified on the plot command line. A range given on the plot line will be used for that single plot command; a range given by a set command will be used for all subsequent plots that do not specify their own ranges. The same holds true for splot.

Subtopics