Degree symbol formatting problems
Show older comments
Why does Matlab insert spaces in my axis labels like those in the right-hand plot here? ...

If I use the special character for the degree sign, everything's fine like the left-hand side. And it doesn't seem to matter if I choose 'tex' as my 'Interpreter' option ...
figure(1); clf;
subplot (1,2,1); hold on;
[...]
xlabel ('Longitude [°E]'); ylabel ('Latitude [°N]');
title ('2012'); topbox; axis equal;
axis ([-20.5 -13.5 46 52]); set (gca, 'XTick', -20:2:-14, 'YTick', 46:2:52);
subplot (1,2,2); hold on;
[...]
xlabel ('Longitude [{\circ}E]'); ylabel ('Latitude [{\circ}N]', 'Interpreter', 'tex');
title ('2014'); topbox; axis equal;
axis ([-20.5 -13.5 46 52]); set (gca, 'XTick', -20:2:-14, 'YTick', 46:2:52);
pos = get (gca, 'Position'); cb = colorbar ('horiz'); cbpos = get(cb, 'Position');
cbpos(2) = pos(2) - cbpos(4); set (cb, 'Position', cbpos); set (gca, 'Position', pos);
caxis ([0 12]); set (cb, 'XTick', 0.5:1:11.5, 'XTickLabel', ['J'; 'F'; 'M'; 'A'; 'M'; 'J'; 'J'; 'A'; 'S'; 'O'; 'N'; 'D']);
paper; orient portrait; oname = sprintf('modis_timeseries_v4_0X'); print ('-depsc', '-painters', oname);
I get the same sort of behaviour with Matlab v2020a if I try to use superscript - anomalous spacing in my labels. What am I doing wrong?
I know this sort of question has been asked before, but I'm not finding the solution working for me.
Thanks in advance for any help anyone can offer.
1 Comment
Andrew Yool
on 27 Nov 2020
Answers (1)
madhan ravi
on 11 Sep 2020
0 votes
I certainly do not see that behaviour 2020a.
1 Comment
Andrew Yool
on 27 Nov 2020
Categories
Find more on Printing and Saving in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!