Search code examples
plotgraphgnuplotoctaveaxis

Specifying axis's step sizes in graph


I'm trying to plot a graph in Octave. How can I specify the axis's step size? For example, by default x axis's step size is 0.5(0---0.5---1---1.5---), I want to make it 0.1, and y axis's step size 0.01.


Solution

  • This will change the step size on the x axis of an existing plot to 0.1:

    xbounds = xlim()
    set(gca, 'xtick', xbounds(1):0.1:xbounds(2))
    

    You can do the same thing for the y axis using ylim and 'ytick'.