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')