relabel x axis tick marks
Ältere Kommentare anzeigen
Hi,
Sorry for what seems an easy question, but I have been searching and have not found the answer.
I want to relabel the data points on the x-axis. Currently the x-axis is axis([0.27 0.9 0 1]) and I want the values shown to range from 30 to 85 rather than 0.27 to 0.9. So where the graph currently had label 0.27 on the x axis, replace that with 30 and so on upto replacing 0.9 with 85.
axis([30 85 0 1]) obviously puts the axis out of range of the data. Hope that makes sense, thanks in advance,
Rhys
Akzeptierte Antwort
Weitere Antworten (2)
Rhys
am 2 Aug. 2011
Fangjun Jiang
am 2 Aug. 2011
set the 'XTickLabel' property of the axes.
h=axes;
get(h,'XTickLabel') % shows 0 to 1
set(h,'XTickLabel',num2str((1:11)')) %shows 1 to 11
2 Kommentare
Walter Roberson
am 2 Aug. 2011
You indicate to set the XTick property but show setting the XTickLabel property.
Fangjun Jiang
am 2 Aug. 2011
Thanks! Updated.
Kategorien
Mehr zu Axis Labels finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!