Matlab 2015a inserts space before µ in long strings, but not in short ones (xlabel). In some cases one can work around by using UTF-8 letters, but this will fail in other situations (see ^2)
The font of the text should be Helvetica but it looks different. Although get Fontname returns Helvetica.
This is a bug in MATLAB and already reported. I do not want to wait months until MATHWORKS fixes this bug.
How can I fix this bug my self? I tried to change the renderer to opengl, but this mixes up all fonts even worse.
plot([2014 2015 2016], [0 1 0]) xlabel('MATLAB (\mu)') ylabel('Space-bugs (\mum^2) (µm²) (µm^2)') title('Number of wrong spaces in MATLAB') textTT = text(2015-1, 1/2,'ugliest plot bugs ever', 'FontSize', 20, 'FontName', 'Helvetica'); text(2015, 1/3, get(textTT, 'Fontname')) % says Helvetica, but lies. print -depsc2 -r864 -painters '/tmp/test.eps' print -dpdf -r864 -painters '/tmp/test.pdf' code rendered in Matlab 2015a on Linux 64 Bit
same code rendered in Matlab Windows 64 Bit by Luis Mendo:
EDIT: The bug is still present in 2015b and 2016a. The bug shows up in the Linux version, but not in the Windows version.
0 comments:
Post a Comment