How to change the x axis label
Show older comments
Hello!
I am plotting a matrix output using imagesc and my x-axis is labeled from 1-151 however I would like the x-axis labels to be between 4.5:.01:6 but still display the full contents of the image. How would I do the relabeling? Thank you in advance.
Accepted Answer
More Answers (1)
Azzi Abdelmalek
on 31 May 2013
xt=get(gca,'xtick')
new_xt=num2cell(linspace(4,6,numel(xt)))
set(gca,'xticklabel',new_xt)
Categories
Find more on Axis Labels in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!