Remove the bottom x-axis line of a plot
587 次查看(过去 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!