MATLAB: How to stop Print to PDF from changing the axis 2019b

axisgraph axisMATLABpdfprintprint functionx axis

I have the following code when triyng to plot a graph:
figure
fig = gcf;
ax = gca;
fig.PaperUnits = "centimeters"
fig.PaperSize = [8 8]
fig.Units = "centimeters";
fig.PaperPosition = [0 0 7 7]
plot(Angle_A_pris, PSD_A_pris, 'G')
ImageDPI=1500;
ylim([400 2525]);
xlim([10 80])
xlabel('2\theta (^o)');
ylabel('Intensity (arbitary units)')
ax.YTickLabel = [];
ax.XTickLabel = "manual";
ax.XTickLabel = [10 20 30 40 50 60 70 80]
print(gcf, 'Glass_A_pristene', '-dpdf', '-fillpage');
When I run it in Matlab it produces this:
Glass_A_pristene.png
But when it is in the pdf format it is created as shown below:
Screen Shot 2019-12-16 at 11.17.17.png
Why is this occuring and how do i stop it?
thank you,
Lucas.

Best Answer

Hi Guys,
Sorry to answer my own question so quickly but it was solved by a collegue minutes after positng this
If you define the fontsize before the print line as:
ax.FontSize = 8
print(x,y,z)
then the pdf then displays the informaiton correctly.