devtools::install_github("idot/idoplots")
-
discrete_fill() and discrete_colour() for ggplot2 creates a discrete colour scale based on brewer for n <= 9 and hues ("I want hues") for n > 9 (random=FALSE -> reproducible)
-
xrot() rotates the x-axis labels for ggplot2
ggplot(data.frame(x=c("A","B","C"),y=1:3), aes(x=x,y=y,colour=x)) + geom_point() + discrete_colour() + xrot()
- scale_fill_bty() and scale_color_bty() creates BTY color scale
ggplot2::ggplot(data.frame(x=1,y=1:255), ggplot2::aes(x=x,y=y,color=y,fill=y)) + ggplot2::geom_bar(stat="identity") + scale_color_bty() + scale_fill_bty()
- grid_arrange_shared_legend() combines multiple plots with a shared legend
p1 <- ggplot2::ggplot(data.frame(x=c("A","B","C"),y=1:3), ggplot2::aes(x=x,y=y,colour=x)) + ggplot2::geom_point()
p2 <- ggplot2::ggplot(data.frame(x=c("A","B","C"),y=1:3), ggplot2::aes(x=x,y=y,colour=x)) + ggplot2::geom_point()
grid_arrange_shared_legend(p1, p2)