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개)
카테고리
도움말 센터 및 File Exchange에서 Printing and Saving에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!