Separate palettes for facets in ggplot facet_grid

久未见 提交于 2019-12-01 06:42:07

faking a colour scale with transparency might be your best option, unless you're willing to combine multiple pieces at the grid/gtable level.

ggplot(diamonds) + 
  geom_bar(aes(x = clarity, stat = "bin", fill = cut, 
               alpha=arbitrary, group = arbitrary)) + 
  facet_grid(cut~.) + 
  scale_fill_manual(values = brewer.pal(name="Set1", n=5), guide="none") +
  scale_alpha_manual(values=c(0.8, 0.6, 0.4))

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!