I am trying to produce a simple scatter plot but with the x scale reversed (as this will be a better way of showing that y (shared species) declines with increasing x (environmental parameter)). The plot works fine with both axes ascending...
envsum$chemo.index <- c(0.56254404, 2.73595615, 2.47705543, 0.01796475)
envsum$sp_shared <- c(66.6, 100.0, 83.9, 62.8)
gShareSP <- ggplot(envsum, aes(chemo.index, sp_shared))
gShareSP <- gShareSP + geom_point()
gShareSP <- gShareSP + geom_errorbarh(xmax=ch.ind+seCh, xmin=ch.ind-seCh)
gShareSP <- gShareSP + geom_smooth(method="lm", se=F, colour="black")
gShareSP <- gShareSP + theme_bw()
gShareSPbut when I add the line
gShareSP <- gShareSP + scale_x_reverse()errorbars disappear (except one which moves to a random point on the plot)
I didn't think scale_x_reverse should alter the positions of the error bars and I can't find the fix to stop it happening
Thanks in advance for any insight
I am trying to produce a simple scatter plot but with the x scale reversed (as this will be a better way of showing that y (shared species) declines with increasing x (environmental parameter)). The plot works fine with both axes ascending...
envsum$chemo.index <- c(0.56254404, 2.73595615, 2.47705543, 0.01796475) envsum$sp_shared <- c(66.6, 100.0, 83.9, 62.8) gShareSP <- ggplot(envsum, aes(chemo.index, sp_shared)) gShareSP <- gShareSP + geom_point()
gShareSP <- gShareSP + geom_errorbarh(xmax=envsum$chemo.index+seCh, xmin=envsum$chemo.index-seCh)
gShareSP <- gShareSP + geom_smooth(method="lm", se=F, colour="black") gShareSP <- gShareSP + theme_bw() gShareSP
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.