R2018a figure files do not preserve font sizes for captions and titles
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
when I create and save a figure, I expect to be able to reload something that looks exactly like what I saved. but, as the script below demonstrates, while I created and saved a figure that had a 24-point title, the title in the reloaded figure had a font size of 15.4 points.
same thing happens for the axis labels. they had 20-point font sizes when I created and saved them, but the 'reloaded from file' figure has 15.4-point font sizes.
FWIW, the script below worked as expected in R2014b (i.e., the title font size would be 24 points when I reloaded the figure file). but I've recently upgraded to R2018a from R2014b, so I may have missed out on some deep-in-the-weeds configuration info that I'm failing to heed.
I'd appreciate any tips anyone can offer that will help restore the old WYSIWYG(ntyltf) behavior (i.e., what you save is what you get next time you load the file
x = -1:0.01:1;
y = x.^3 + 2*x.^2 + 3*x;
plot(x, y, '-g', 'LineWidth', 2);
set( gca, 'FontSize', 14 );
grid on;
xlabel('Arbitrary Values', 'FontSize', 20);
ylabel('x^3 + 2x^2 + 3x', 'FontSize', 20);
title('Figure Font Test', 'FontSize', 24, 'FontWeight', 'normal');
savefig('FigureFontTest00.fig');
%
% create FigureFontTest00-OriginalScreenCapture.png
%
openfig('FigureFontTest00.fig');
%
% create FigureFontTest00-ScreenCaptureFromSavedFigFile.png
%
hF2T = get(gca,'title')
hF2T =
Text (Figure Font Test) with properties:
String: 'Figure Font Test'
*FontSize: 15.4000*
FontWeight: 'normal'
FontName: 'Helvetica'
Color: [0 0 0]
HorizontalAlignment: 'center'
Position: [1.2789e-06 6.0931 0]
Units: 'data'
Show all properties
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!