Remove the bottom x-axis line of a plot
조회 수: 586 (최근 30일)
이전 댓글 표시
채택된 답변
추가 답변 (1개)
Veronica Taurino
2022년 5월 26일
편집: Veronica Taurino
2022년 5월 26일
In general, to move your x-asix on top:
set(gca,'XAxisLocation','top')
To hide the axis:
set(gca,'xtick',[])
or
h = gca;
h.XAxis.Visible = 'off';
댓글 수: 2
Veronica Taurino
2022년 5월 26일
편집: Veronica Taurino
2022년 5월 26일
I gave you more options because your need is not clear to me. You should try one of the above. I think the first one could be fine:
x = 0:pi/100:2*pi;
y = sin(x);
plot(x,y)
set(gca,'XAxisLocation','top')
참고 항목
카테고리
Help Center 및 File Exchange에서 Axis Labels에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!