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

后端 未结 9 1342
再見小時候
再見小時候 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:50

    By default, plot does show axes, unless you've modified some settings. Try the following

    hold on; % make sure no new plot window is created on every plot command
    axes(); % produce plot window with axes
    plot(% whatever your plot command is);
    plot([0 10], [0 0], 'k-'); % plot the horizontal line
    

提交回复
热议问题