O'Reilly logo

GNU Octave by Jesper Schmidt Hansen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 the text function:
    octave:65> set(gca, "xlabel", text("string", "x", "fontsize", ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required