Remove the bottom x-axis line of a plot
586 ビュー (過去 30 日間)
古いコメントを表示
採用された回答
TTA
2022 年 5 月 26 日
その他の回答 (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!