How to show x and y axes in a MATLAB graph?

后端 未结 9 1359
再見小時候
再見小時候 2021-02-13 09:27

I am drawing a graph using the plot() function, but by default it doesn\'t show the axes.

How do we enable showing the axes at x=0 and y=0 on th

9条回答
  •  深忆病人
    2021-02-13 09:54

    Inspired by @Luisa's answer, I made a function, axes0

    x = linspace(-2,2,101);
    plot(x,2*x.^3-3*x+1);
    axes0
    

    You can follow the link above to download the function and get more details on usage

提交回复
热议问题