【问题标题】:ggplot doesn't display the colors in the bar graphggplot 不显示条形图中的颜色
【发布时间】:2020-10-05 14:52:24
【问题描述】:

我下面的条形图没有显示条形中的颜色。

ggplot(top5_energyProducersMod, aes(year, ggwt_hours), fill = year) +
  geom_bar(stat = "identity", position = "dodge") +
  facet_wrap(~country_name)

我使用的是 R studio 桌面版

【问题讨论】:

    标签: r ggplot2


    【解决方案1】:

    填充颜色符合美学:

    ggplot(top5_energyProducersMod, aes(year, ggwt_hours,fill = year)) +
      geom_bar(stat = "identity", position = "dodge") +
      facet_wrap(~country_name)
    

    【讨论】:

    • 是的。非常感谢
    • @dly,很高兴我能帮上忙。如果这解决了问题,请考虑accepting the answer,以便其他人也可以从中受益。
    猜你喜欢
    • 1970-01-01
    • 2021-09-16
    • 2022-12-03
    • 2021-07-16
    • 2020-10-05
    • 1970-01-01
    • 2022-01-24
    • 1970-01-01
    • 2021-10-29
    相关资源
    最近更新 更多