【问题标题】:I need to change my ggplot colours to grey shades in r我需要将我的 ggplot 颜色更改为 r 中的灰色阴影
【发布时间】:2023-03-20 00:27:01
【问题描述】:

我有这个代码:

performance %>%
    ggplot(aes(Sexo, fill = factor(PLM.year1))) +
    geom_bar(position = "fill")

它给了我一些奇怪的颜色..我想要它们是灰色的..请问我该如何改变它?

【问题讨论】:

标签: r ggplot2


【解决方案1】:

尝试添加

+ scale_fill_grey(start=0.8, end=0.2)

基于ggplot2 documentation

【讨论】:

  • 不用担心,如果答案对您有帮助,请接受建议的答案:)
  • 是的,我做到了;)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-12-02
  • 1970-01-01
  • 2019-11-02
  • 2021-08-08
  • 2019-06-30
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多