How to remove ticks of right y-axis when plot two y-axes figure using yyaxis
69 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ying Wu
am 16 Nov. 2021
Bearbeitet: ANKUR KUMAR
am 16 Nov. 2021
Hi, when I use yyaxis left and yyaxis right to plot two y-axes figure, the y-ticks would be generated automatically. And I want to remove the ticks of right y-axis and only keep that of left axis. If I use set(gca,'ytick',[]), the left ticks would be removed. Could anyone please tell me how to do that?
I obtain this figure and I want to remove the orange ticks.
0 Kommentare
Akzeptierte Antwort
ANKUR KUMAR
am 16 Nov. 2021
Bearbeitet: ANKUR KUMAR
am 16 Nov. 2021
You can simply use yticks([]) after calling the yyaxis right. This simply remove all the ticks from the right y axis.
x = linspace(0,10);
y = sin(3*x);
yyaxis left
plot(x,y)
z = sin(3*x).*exp(0.5*x);
yyaxis right
plot(x,z)
ylim([-150 150])
yticks([])
0 Kommentare
Weitere Antworten (0)
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!