Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 205330

gradient filled plot panels with facet_wrap

$
0
0

I did the following barchart by using:

ggplot(yearplot,aes(x=reorder(vE,release.year), y=difference,fill=PAR,label=signif.))  + 
  geom_bar(stat='identity',position = "dodge",  size=3 ,alpha=1)  +
  geom_text(aes(x = vE, y = difference+0.03 , label = format(signif., nsmall = 0, scientific = FALSE)), 
  color="black",size=6) +
  xlab("Genotypen")+
  ylab("Differenz")+
  theme_bw()+
  ylim(-0.2,0.2)+
  facet_wrap(~number,labeller = labeller(number=date.wrap),nrow=1)+
  coord_flip()+
  scale_fill_gradient2(name="PAR \n[mol/m² s]",low="darkblue",mid = "orange1",high = "orangered4",limits=c(1200, 2100),midpoint = 1200)+
  theme(legend.position="top")+
  theme(legend.key.size = unit(3,"line"),
        legend.title = element_text(size = 16,face="bold"),
        legend.text = element_text(size = 14))+
  theme(axis.text=element_text(size=14,face="bold"),
        axis.title=element_text(size=16,face="bold"),
        strip.text = element_text(size=16,face="bold"))

enter image description here

I would like to add temperature values as gradient filled plot panels, similar to the PAR values. So for example the plot panel of june 1 is light green and june 6 is dark green and the rest between. In the data frame is one temperature value for each day. Is there any possibilty to do that?


Viewing all articles
Browse latest Browse all 205330

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>