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

Im trying to create a three way interaction plot but my x axis labels are messed up

$
0
0

Im trying to create a three way interaction plot but my x axis labels not according to my independent variable of P treatment which is "0,3,6,12,36".

I have tried to put in the code, levels = c("0","3","6","12","36") but it throws out this....

enter image description here

ggplot(tg2, aes(
         x = factor(interaction(cultivar, P),levels = c("0","3","6","12","36")),
         y = shoot, fill = waterlogg)) + 
  geom_bar(stat="identity", position = "dodge",colour="black",
           size=.1)+
  geom_errorbar(aes(ymin=shoot-se, ymax=shoot+se),
                size=0.3,
                width=.2,            
                position=position_dodge(.9))+
  scale_x_discrete(drop = FALSE)+
  facet_wrap(~cultivar, ncol=2)

Viewing all articles
Browse latest Browse all 205466

Trending Articles



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