如何更改绘图标题和轴标签的字体大小并保存? [英] How to change the font size of a plot's title and axis labels and save it?

查看:110
本文介绍了如何更改绘图标题和轴标签的字体大小并保存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我将打印图片保存为jpg或png时,标题和轴标签的字体大小会自动更改为默认值.我的代码是这样的:

Every time I save a plot picture as jpg or png, font size of title and axis label is changed back to default automatically. My code is like this:

figure
plot(x, f(x))
title('the smallest n = 1', 'FontSize', 24);
xlabel('x', 'FontSize', 24);
ylabel('x''', 'FontSize', 24);

保存图片后,这些字体大小再次变小.有人知道为什么吗?

After saving the picture, those font sizes become small again. Anyone knows why?

推荐答案

因为它仅适用于当前图形.

Because it just applies for the current figure.

如果要为整个会话设置相同的字体大小,请使用:

If you want to set the same font size for the whole session, use:

set(0,'defaultAxesFontSize', 12);

如果要永久保留,请将其放入启动文件中.

If you want that permanently, put it in your start-up file.

顺便说一句,您可以在 此处 ,您可以通过串联default + class name + property来构建所需的每个默认属性".

By the way, as you can see here you can build every "default property" you wish by concatenating default + class name + property.

这篇关于如何更改绘图标题和轴标签的字体大小并保存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆