Degree symbol formatting problems
古いコメントを表示
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 件のコメント
Andrew Yool
2020 年 11 月 27 日
回答 (1 件)
カテゴリ
ヘルプ センター および File Exchange で Printing and Saving についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!