Low-Level plotting commands Next: Interaction with gnuplot Previous: Multiple Plot Windows Up: Plotting
gplot ranges expression using title style | Command |
Generate a 2-dimensional plot.
The ranges using, title, and style arguments are optional and the using, title and style qualifiers may appear in any order after the expression. You may plot multiple expressions with a single command by separating them with commas. Each expression may have its own set of qualifiers. The optional item ranges has the syntax [ x_lo : x_up ] [ y_lo : y_up ] and may be used to specify the ranges for the axes of the plot
independent of the actual range of the data. The range for the y axis
and any of the individual limits may be omitted. A range The expression to be plotted must not contain any literal matrices
(e.g. See the help for By default the gplot rand (1001) with linespoints will plot 100 random values and connect them with lines. When
If there are more than two columns you can choose which columns to plot with the using qualifier. For example given the data x = (-10:0.1:10)'; data = [x sin(x), cos(x)]; the command gplot [-11:11] [-1.1:1.1] \ data with lines data using 1:3 with impulses will plot two lines. The first line is generated by the command
The clause In this example the ranges have been explicitly specified to be a bit larger than the actual range of the data so that the curves do not touch the border of the plot. |
gsplot ranges expression using title style | Command |
Generate a 3-dimensional plot.
The ranges using, title, and style arguments are optional and the using, title and style qualifiers may appear in any order after the expression. You may plot multiple expressions with a single command by separating them with commas. Each expression may have its own set of qualifiers. The optional item ranges has the syntax [ x_lo : x_up ] [ y_lo : y_up ] [ z_lo : z_up ] and may be used to specify the ranges for the axes of the plot
independent of the actual range of the data. The range for the y and z
axes and any of the individual limits may be omitted. A range
The expression to be plotted must not contain any literal matrices (e.g.
See the help for By default the gsplot rand (5 2) will plot a random surface with the x and y values taken from the row and column indices of the matrix. If parametric plotting mode is set (using the command
gset parametric then 1 1 3 2 1 6 3 1 9 1 2 2 2 2 5 3 2 8 1 3 1 2 3 4 3 3 7 but not |
gset options | Command |
gshow options | Command |
replot options | Command |
In addition to the basic plotting commands the whole range of
gset and gshow commands from gnuplot are available
as is replot .
Note that in Octave 2.0 the The The For example gset term tek40 gset output "/dev/plotter" gset title "sine with lines and cosine with impulses" replot "sin (x) w l" will change the terminal type for plotting add a title to the current plot add a graph of sin (x) to the plot and force the new plot to be sent to the plot device. This last step is normally required in order to update the plot. This default is reasonable for slow terminals or hardcopy output devices because even when you are adding additional lines with a replot command gnuplot always redraws the entire plot, and you probably don't want to have a completely new plot generated every time something as minor as an axis label changes. The command |
Note that NaN values in the plot data are automatically omitted and Inf values are converted to a very large value before calling gnuplot.