ggplot增加边界线粗细

时间:2018-11-10 15:24:38

标签: r ggplot2

如何增加蓝色边框线的粗细?在下面的示例中,stroke参数被忽略。

library(tidyverse)
ggplot(mpg, aes(cty, hwy)) + 
  geom_col(color = "blue", stroke = 2)

2 个答案:

答案 0 :(得分:2)

geom_col没有stroke参数。试试这个:

   library(tidyverse)
   ggplot(mpg, aes(cty, hwy)) + 
   geom_col(color = "blue", size = 2)

答案 1 :(得分:2)

希望这对您有用:

ggplot(mpg, aes(cty, hwy,fill="snow")) + 
  geom_bar(color = "navy",size=0.05,stat="identity",alpha=0.3)

结果: enter image description here

然后改变尺寸的美感:

ggplot(mpg, aes(cty, hwy,fill="snow")) + 
  geom_bar(color = "navy",size=2,stat="identity",alpha=0.3)

认为: enter image description here