简介
字符倾斜,指定为以下值之一:
- ‘normal’ -没有字符倾斜(default)
- ‘italic’——倾斜的字符
并不是所有的字体都有两种字体样式。 因此,斜体字体可能看起来与正常字体相同。
代码实例(复杂版)
plot(rand(3))
lgd = legend('a','b','c');
c = lgd.FontAngle;
lgd.FontAngle = 'italic';
上图,看效果:
代码实例(简单版)
用法: {\it{要倾斜的字符串}}
可解决一个字符串中部分字体倾斜,部分不倾斜的问题。
plot(rand(3))
lgd = legend('{\it{a}}','{\it{bc}}bdfg','c');
上图,看效果:bcddfg中只倾斜bc
常用字体修饰用法
字体大小: 15
- ‘FontSize’,15
主题字体: Times New Roman
- ‘FontName’,‘Times New Roman’
斜体: italic
- ‘FontAngle’,‘italic’
图的线标识位置: southwest
- ‘location’,‘southwest’
图中线的宽度: 1.5
- ‘linewidth’,1.5
- ‘LineWidth’,2
参考资料:matlab help文档