|
|
Setting the ranges for Two-dimensional plots
|
University of Hawaii at Manoa
College of Engineering
|
Note that gnuplot automatically sets the range for the x and y variables.
you can specify ranges for none, either or both the x and y axes. For example,
you can tell gnuplot to plot exactly two cycles of the sine wave by setting
the x range to go from -2 pi to 2 pi, which is represented below as
[ -2 * pi : 2 * pi ].
The command looks like this:
plot [-2 * pi : 2 * pi] sin(x)
By specifying two ranges, you can also control the y range as well. This
example shows the plot's y-axis going from -1.5 to 1.5:
plot [-2 * pi : 2 * pi] [-1.5:1.5] sin(x)
These ranges can also be set using the set xrange and
set yrange commands.
|