每次我将绘图图片保存为jpg或png时, Headers 和轴标签的字体大小会自动更改回默认值 . 我的代码是这样的:
figure plot(x, f(x)) title('the smallest n = 1', 'FontSize', 24); xlabel('x', 'FontSize', 24); ylabel('x''', 'FontSize', 24);
保存图片后,这些字体大小再次变小 . 谁知道为什么?
因为它只适用于当前的数字 .
如果要为整个会话设置相同的字体大小,请使用:
set(0,'defaultAxesFontSize', 12);
如果您想永久保存,请将其放入启动文件中 .
顺便说一下,你可以看到here你可以通过连接 default + class name + property 构建你想要的每个"default property" .
default + class name + property
我发现“print”命令可以解决这个问题 .
fig = figure; plot(x, f(x)); title('the smallest n = 1', 'FontSize', 24); xlabel('x', 'FontSize', 24); ylabel('x''', 'FontSize', 24); print(fig, 'PicName', '-dpng');
第三个参数是指定格式 . 在我的情况下,我想将其保存到png文件 .
字体大小将保持我现在设置的值 .
2 回答
因为它只适用于当前的数字 .
如果要为整个会话设置相同的字体大小,请使用:
如果您想永久保存,请将其放入启动文件中 .
顺便说一下,你可以看到here你可以通过连接
default + class name + property
构建你想要的每个"default property" .我发现“print”命令可以解决这个问题 .
第三个参数是指定格式 . 在我的情况下,我想将其保存到png文件 .
字体大小将保持我现在设置的值 .