Search code examples
plotoctavescaleoctave-gui

Change scale of axes in octave plot


I am using the plot function of to plot a graph. The code is as below -

plot([1; 2; 3; 4], [1; 2; 3; 4]);

The graph looks as below - enter image description here

As you can see, the plot is using a scale of 1.5 on both x and y axes. I want to change the scale to 1 on both axes. How can I do this?


Solution

  • You can use the xticks and yticks commands to set the ticks to what you prefer. E.g.

    xticks( 1:4 )
    yticks( 1:4 )