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

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

    I know this is coming a bit late, but a colleague of mine figured something out:

    figure, plot ((1:10),cos(rand(1,10))-0.75,'*-')
    hold on
    plot ((1:10),zeros(1,10),'k+-')
    text([1:10]-0.09,ones(1,10).*-0.015,[{'0' '1'  '2' '3' '4' '5' '6' '7' '8' '9'}])
    set(gca,'XTick',[], 'XColor',[1 1 1])
    box off
    

提交回复
热议问题