Remove the bottom x-axis line of a plot
604 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
Please how can I remove the bottom line of X-axis of a plot and leave the top x-axis line
Thanks
0 Kommentare
Akzeptierte Antwort
TTA
am 26 Mai 2022
Weitere Antworten (1)
Veronica Taurino
am 26 Mai 2022
Bearbeitet: Veronica Taurino
am 26 Mai 2022
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 Kommentare
Veronica Taurino
am 26 Mai 2022
Bearbeitet: Veronica Taurino
am 26 Mai 2022
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')
Siehe auch
Kategorien
Mehr zu Axis Labels finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!