How do I center axis labels in pcolor graph?
25 views (last 30 days)
Show older comments
Alok Virkar
on 10 Nov 2020
Commented: Douglas Anderson
on 13 Sep 2022
I have a pcolor "checkerboard plot" , how do I center the axis values to the center of the box (but still on the axis). I am using matlab 2012b.
Heres some code:
figure;
pcolor(1:13,1:5,ones(5,13))
xt = 1:12;
yt = 1:4;
set(gca,'XTick',xt)
set(gca,'YTick',yt)
0 Comments
Accepted Answer
Alok Virkar
on 16 Nov 2020
1 Comment
Douglas Anderson
on 13 Sep 2022
I would like to thank you, Alok! I tried using heatmap() for the same kind of problem, and was frustrated at every turn. This ended up as a very simple, elegant solution.
More Answers (1)
See Also
Categories
Find more on Geographic Plots 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!