0

I'm using a Matlab code in Linux and trying to export a figure into png or tiff format but Matlab changes the text to a default font type and size. I don't have that problem when I'm exporting into pdf format. Is there a way to fix this?

Here is an example code with the same issue:

x=1:1:100;
y=x.^2+5;

plot(x,y)

xlabel('x Data', 'fontname', 'Arial', 'fontweight', 'bold')
ylabel('y Data', 'fontname', 'Times', 'fontweight', 'normal')

print('test','-dpng','-r300')
David
  • 8,449
  • 1
  • 22
  • 32
  • Do you have Arial available on Linux? – Cris Luengo Oct 13 '19 at 21:26
  • Yes, it is available! – bkhazaei Oct 13 '19 at 21:54
  • 1
    [This](https://stackoverflow.com/questions/16218979/changing-figure-fonts-in-matlab-has-no-effect) and [this](https://au.mathworks.com/matlabcentral/answers/1238-font-size-changes-in-figures#answer_39697) might be related, they are pretty dated though and I can't test them. – David Oct 14 '19 at 00:26

0 Answers0