Last active
August 29, 2015 14:20
-
-
Save cdiener/f5fe3d166eb6b5c2e959 to your computer and use it in GitHub Desktop.
ggplot2 grouped points with horizontal means
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(scales) | |
library(Hmisc) | |
emsa_plot = ggplot(emsa, aes(x=Name, y=intensity, shape=charge_ratio, col=charge_ratio, width=0.8)) + | |
geom_point(size=3, position=position_dodge(width=0.8)) + | |
stat_summary(fun.data=mean_sdl, mult=0, color="black", geom="errorbar", size=1, position=position_dodge(width=0.8)) + | |
scale_color_grey(start=0, end=0.5,name="charge ratio") + | |
scale_shape(name="charge ratio") + | |
scale_y_continuous(limits=c(-0.05,1), breaks=seq(0,1,by=0.2), label=percent) + | |
xlab("") + ylab("DNA retention (%)") + pub_theme + | |
theme(axis.text.x = element_text(angle=45, hjust=1), legend.position=c(0.5,0.25)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment