ggplot(diamonds,aes(cut, group=1)) + geom_bar()+
geom_freqpoly(stat="count",size=2) + scale_color_pub() + theme_pub(line_width=1)
dat <- data.frame()
for(i in 1:4)
dat <- rbind(dat, data.frame(set=i, x=anscombe[,i], y=anscombe[,i+4]))
ggplot(dat, aes(x, y)) + geom_point(size=5, color="red",
fill="orange", shape=21) + geom_smooth(method="lm", fill=NA,
fullrange=TRUE) + facet_wrap(~set, ncol=2)
Run the code above in your browser using DataLab