改变整行geom_boxplot()的厚度

时间:2022-06-15 13:06:28

I would like to increase the boldness of the entire boxplot to be more visible on the hard copy. from Here seems "fatten" parameter change the thickness of the only median line. Is there any other parameter that control the thickness/width of the the whole box plot ?

我想增加整个boxplot的大胆度,以便在硬拷贝上更加醒目。从这里看来“胖”参数改变了唯一中线的厚度。是否还有其他参数可以控制整个箱形图的厚度/宽度?

require(reshape)
require(ggplot2)
cars_melt = melt(cars)

ggplot(aes(x = variable, y = value), data = cars_melt) + 
  geom_boxplot(fatten = 2) 

1 个解决方案

#1


20  

Use geom_boxplot(lwd=3) ("lwd" for "line width"). Also, if lwd makes the median too thick, you can use lwd and fatten together to make the median line thinner relative to the other lines.

使用geom_boxplot(lwd = 3)(“lwd”代表“行宽”)。此外,如果lwd使中位数太厚,您可以使用lwd和fatten一起使中线相对于其他线更薄。

#1


20  

Use geom_boxplot(lwd=3) ("lwd" for "line width"). Also, if lwd makes the median too thick, you can use lwd and fatten together to make the median line thinner relative to the other lines.

使用geom_boxplot(lwd = 3)(“lwd”代表“行宽”)。此外,如果lwd使中位数太厚,您可以使用lwd和fatten一起使中线相对于其他线更薄。