【问题标题】:Change the size of header panel in lattice plot更改格子图中标题面板的大小
【发布时间】:2016-06-27 17:04:00
【问题描述】:

我想在其中更改header panel size 以及textfont size。这是一个例子:

library(lattice)
dat <-data.frame(a=(rnorm(50)),b=(rnorm(50)),c=(c(rep("first",25),rep("second",25))))
xyplot(a~b|c, data=dat,par.settings = list(strip.background=list(col="gray")))

基本上我需要gray area 的大小以及"first""second" 的字体大小更大。

【问题讨论】:

    标签: r plot lattice


    【解决方案1】:

    您需要使用par.strip.text= 参数,它接受一个列表,其中包含指定cexfontlineslineheight 中的任何一个的组件(后者在任何多行带之间提供空格标题)。

    例如,试试这个:

    stripParams <- list(cex=2, lines=1.5)
    xyplot(a~b|c, data=dat,
           par.strip.text = stripParams,
           par.settings = list(strip.background=list(col="gray")))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-18
      • 2020-07-07
      • 2018-02-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-30
      • 1970-01-01
      相关资源
      最近更新 更多