【问题标题】:GGPlots legend colors more clearGGplots图例颜色更清晰
【发布时间】:2017-09-26 07:31:24
【问题描述】:

有什么方法可以让这些颜色在我的geom_barggplot 图表中更加明显?特别是蓝色/绿色的。还有一种方法可以像顶部和底部那样在颜色之间设置白线/空格吗?

【问题讨论】:

  • 您可以尝试使用其他调色板,例如 ggthemr
  • 对于白线,请尝试在您的geom_bar() 中添加colour = "white"?
  • geom_bar (color = "white") 不起作用
  • 请提供reproducible example。到目前为止你尝试过什么?

标签: r ggplot2 legend geom-bar


【解决方案1】:

colour = "white" 应该可以帮助您区分颜色。如果没有,则增加size=2。例如:

library(vcd)
data(Arthritis)
ggplot(Arthritis, aes(x = Treatment, fill = Improved)) + 
  geom_bar(colour = "white", size=2)

【讨论】:

    猜你喜欢
    • 2018-10-26
    • 2016-08-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-26
    • 2015-09-04
    • 2022-01-17
    • 2018-01-20
    相关资源
    最近更新 更多