简体   繁体   English

如何在绘图的第二个主标题行中更改字体大小

[英]How to change the font size in the second main title line of a plot

In addition to this question ( How to split the Main title of a plot in 2 or more lines? ) I tried to give the second main title line another font size. 除了这个问题( 如何将图的主标题分成两行或更多行? ),我还尝试为第二个主标题行赋予另一个字体大小。 cex.main=1 only varies the entire main title. cex.main=1cex.main=1整个主标题。

So I haven't found anything how it could work… 所以我还没有找到任何可行的方法……

Has anyone some hints? 有没有人暗示?

Many thanks in advance! 提前谢谢了!

My code: 我的代码:

    plot(1, main=paste("X:",1," ","Y:", 2," ","\nZ:",3)) # the “Z: 3” should get a smaller font size

Alternative to adding second main title and increase font size would be to use title() with plot() . 添加第二个主标题和增加字体大小的替代方法是将title()plot() With title() you could also add and manipulate position of "second title" and also font type. 使用title()您还可以添加和操纵“第二个标题”的位置以及字体类型。

So the code looks like this: 因此,代码如下所示:

    plot(1, main = paste("X:",1," ","Y:", 2," ")) 
   # In order to change font size use cex.main and in order to manipulate 
   # the position of second title use line()
  title(main = ("Z: 3"),  line = 0.5, cex.main = 0.8)

And the output (font of Z: 3 is smaller) 和输出(Z的字体:3较小) 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM