Skip to content

Instantly share code, notes, and snippets.

@johnschrom
Created May 2, 2014 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnschrom/aaead8439ae095b70c44 to your computer and use it in GitHub Desktop.
Save johnschrom/aaead8439ae095b70c44 to your computer and use it in GitHub Desktop.
Chart plot formats with ggplot2
library(ggplot2)
library(grid)
ggplot(data, aes(x=x, y=y)) +
geom_point() +
# geom_line() +
ylab('y label') +
xlab('x label') +
theme_bw() +
scale_color_manual(values = c('#023F8A', '#BF4D28')) +
theme(legend.position = 'none') +
# theme(legend.position=c(0.88,0.88), legend.background = element_rect(colour=NA), legend.title = element_blank()) +
theme(axis.title.x=element_text(size=16, family='Open Sans Light', vjust=0)) +
theme(axis.title.y=element_text(size=16, family='Open Sans Light', vjust=0)) +
theme(axis.text.x = element_text(size=12, family='Open Sans Light')) +
theme(axis.text.y = element_text(size=12, family='Open Sans Light')) +
theme(plot.margin = unit(7,7,7,7), 'mm')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment