facet_wrap()+ ggplot2()中每个方面的独立颜色渐变>> [

问题描述 投票:0回答:1
我正在努力为facet_wrap()中的每个方面分别绘制渐变色标。数据太大,无法在此处发布,但这是我的代码:

ggplot(stack, aes(hour, day)) + geom_tile(aes(fill = percent), colour = "white") + facet_wrap(~author, ncol = 3) + theme_minimal() + scale_fill_distiller(palette = 'RdYlBu') + theme( axis.title.x = element_blank(), axis.title.y = element_blank(), legend.position = "none", strip.background = element_rect(fill = '#E5E6E1'), strip.text = element_text(face = 'bold') )

enter image description here

但是,如果我仅逐个绘制一位作者,则会得到:

enter image description here

我只是想用自己的渐变色标绘制每个构面,而不是与其他构面共享。应该很简单,但是我没有做到。我尝试在group = authoraes()geom_tile()中添加ggplot(),但无法正常工作。

我正在努力为facet_wrap()中的每个方面分别绘制渐变色标。数据太大,无法在此处发布,但这是我的代码:ggplot(stack,aes(hour,day))+ geom_tile(aes(fill = ...

r ggplot2 colors gradient facet-wrap
1个回答
0
投票
[经过大量研究,我最终使用了使用heregridExtra提供的解决方案。我想没有简单的方法可以只使用ggplot
© www.soinside.com 2019 - 2024. All rights reserved.