Skip to content

Instantly share code, notes, and snippets.

@cdiener cdiener/points
Last active Aug 29, 2015

Embed
What would you like to do?
ggplot2 grouped points with horizontal means
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
You can’t perform that action at this time.