Time for action - changing the figure properties
1. Let us try to change the plot of the graph above. First:
octave:61> plot(x, f, "linewidth", 5);
This command will create the same plot as above, but here we specify the graph property linewidth to have the value 5 rather than 1.
2. To set the correct limits on the axis, we use
set:
octave:62> set(gca, "xlim", [-5.5 1])
3. We can also use
set
to set the line width of the window box and the font size of the numbers on the axes:
octave:63> set(gca, "linewidth", 2) octave:64> set(gca, "fontsize", 25)
4. The axes labels are also set by the
set
function. Here the properties are"xlabel"
and"ylabel"
, and the property value is set using thetext
function:
octave:65> set(gca, "xlabel", text("string", "x", "fontsize", 25)) octave:66> set(gca, "ylabel", text("string", "f(x)", "fontsize", 25))
5. The figure should now look something like the figure below:
Note
Many prefer to use single quotation marks around the property label, for...