about axis ticks: how to set 10 ticks with 5 labels?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Yuji Zhang
am 23 Nov. 2013
Kommentiert: Yuji Zhang
am 23 Nov. 2013
Hi everyone,
I want the axis to have ticks at 1:1:10, and tick labels only at 2:2:10
Anybody know how to do this? I tried
x=1:10;
y = x;
plot(x, y)
ylim([0 10])
set(gca,'YTick', 1:1:10, 'YTickLabel', 2:2:10 );
set(gcf,'PaperUnits','inches','PaperPosition',[0 0 2 2])
print(gcf,'-dtiffn','-r600', 'test.tiff');
The result is something that doesn't make sense. See attachment please.
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 23 Nov. 2013
Bearbeitet: Azzi Abdelmalek
am 23 Nov. 2013
x=1:10;
y = x;
plot(x, y)
ylim([0 10])
set(gca,'YTick', 1:1:10, 'YTickLabel', {'' '2' '' '4' '' '6' '' '8' '' '10'} );
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!