The MATLAB-style two-dimensional plotting commands are:
plot (args) | Function File |
This function produces two-dimensional plots. Many different
combinations of arguments are possible. The simplest form is
plot (y) where the argument is taken as the set of y coordinates and the x coordinates are taken to be the indices of the elements starting with 1. If more than one argument is given they are interpreted as plot (x y, fmt ...) where y and fmt are optional and any number of argument sets may appear. The x and y values are interpreted as follows:
If the fmt argument is supplied it is interpreted as follows. If fmt is missing the default gnuplot line style is assumed.
The color line styles have the following meanings on terminals that support color. Number Gnuplot colors (lines)points style 1 red * 2 green + 3 blue o 4 magenta x 5 cyan house 6 brown there exists The fmt argument can also be used to assign key titles. To do so include the desired title between semi-colons after the formatting sequence described above e.g. "+3;Key Title;" Note that the last semi-colon is required and will generate an error if it is left out. Here are some plot examples: plot (x y, "@12", x, y2, x, y3, "4", x, y4, "+") This command will plot plot (b "*") This command will plot the data in the variable t = 0:0.1:6.3; plot (t cos(t), "-;cos(t);", t, sin(t), "+3;sin(t);"); This will plot the cosine and sine functions and label them accordingly in the key. |
hold args | Built-in Function |
Tell Octave to `hold' the current data on the plot when executing
subsequent plotting commands. This allows you to execute a series of
plot commands and have all the lines end up on the same figure. The
default is for each new plot command to clear the plot device first.
For example the command
hold on turns the hold state on. An argument of |
ishold | Built-in Function |
Return 1 if the next line will be added to the current plot or 0 if the plot device will be cleared before drawing the next line. |
clearplot | Built-in Function |
clg | Built-in Function |
Clear the plot window and any titles or axis labels. The name
clg is aliased to clearplot for compatibility with
MATLAB.
The commands gplot clear gsplot clear, and replot
clear are equivalent to |
shg | Function File |
Show the graph window. Currently this is the same as executing replot. |
closeplot | Built-in Function |
Close stream to the gnuplot subprocess. If you are using X11
this will close the plot window.
|
purge_tmp_files | Built-in Function |
Delete the temporary files created by the plotting commands.
Octave creates temporary data files for A future version of Octave will eliminate the need to use temporary files to hold the plot data. |
axis (limits) | Function File |
Set axis limits for plots.
The argument limits should be a 2 4, or 6 element vector. The first and second elements specify the lower and upper limits for the x axis. The third and fourth specify the limits for the y axis and the fifth and sixth specify the limits for the z axis. Without any arguments With one output argument The vector argument specifying limits is optional and additional string arguments may be used to specify various axis properties. For example axis ([1 2, 3, 4], "square"); forces a square aspect ratio and axis ("labely" "tic"); turns tic marks on for all axes and tic mark labels on for the y-axis only. The following options control the aspect ratio of the axes.
The following options control the way axis limits are interpreted.
The option The following options affect the appearance of tic marks.
The following options affect the direction of increasing values on the axes.
|