如何更改传奇中的字体尺寸?

4,453次观看(最近30天)
如何更改传奇标签的字体尺寸?例如,我如何使“一个”,“两个”,“三”,“四个”标签的字体大小在我的情节中更大?
情节(兰德(4))
lgd =传奇('一',,,,'二',,,,'三',,,,'Four');

接受的答案

数学工作Support Team
数学工作Support Team 2020年9月2日
您可以通过设置传奇对象的“字体尺寸”属性来更改MATLAB传说的字体大小。
例如,绘制四行。创建一个传说并将图例对象分配给变量“ LGD”。然后,使用DOT符号访问“ Fontsize”属性并将值设置为14点。
情节(兰德(4))
lgd = legend('一',,,,'二',,,,'三',,,,'Four');
lgd.fontsize = 14;
Alternatively, you can specify the 'FontSize' property using a name-value pair argument in the 'legend' command. When including name-value pair arguments, include the legend labels in a cell array. For example:
传奇({'一',,,,'二',,,,'三',,,,'Four'},'字体大小',14)
4 Comments
乔丹·弗利斯(Jordan Fliss)
这个问题听起来像我现在正在经历的问题。更改设置后,我将图形保存为.fig,关闭图形窗口,然后再次加载图(仅双击它)。在数字重新加载后,实施了我的传奇字体更改。

登录发表评论。

More Answers (3)

Mukesh Jadhav
Mukesh Jadhav 2016年10月9日
干得好 :
h =传奇('X',,,,'y',,,,'z');
set(h,'字体大小',,,,12);
2条评论
贾米尔·汗(Jamil Khan)
贾米尔·汗(Jamil Khan) 2020年10月26日
Legend('x','y','z'),set(传奇,'fontsize',12);
this works aswell, you dont have set the legend as an object

登录发表评论。


ODO22
ODO22 on 1 Dec 2016
l = legend('1',,,,'2',,,,'3');
l.FontSize = 40;

Samson Msgna
Samson Msgna 2018年3月23日
How can we solve Error using CreateDatabase (line 22) Not enough input arguments.
使用Eigenfacecore(第20行)的错误输入参数不足。

下载188bet金宝搏

社区寻宝

在Matlab Central中找到宝藏,发现社区如何为您提供帮助!

Start Hunting!