Created
May 24, 2010 13:04
-
-
Save mja/411831 to your computer and use it in GitHub Desktop.
Options for ggplot2
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
# Options for ggplot + opts(...) | |
# These don't seem to be documented on the web. Listed here for reference. | |
# list current setting | |
theme_get() | |
# Make a plot | |
g <- ggplot(...) | |
# Print the plot with options | |
g + opts(...) | |
panel.background=theme_rect(fill='pink', colour='pink', size=1, linetype=1) | |
# the background of each panel | |
panel.border | |
panel.grid.minor = theme_line() | |
panel.grid.minor=theme_line() | |
# Remove legend. Useful if you want to redo it manually or | |
# you have a factor with lots of levels | |
legend.position="none" | |
# text | |
plot.title = theme_text(size = 40) | |
axis.title.x = theme_text() | |
axis.text.x = theme_text(angle=, size=, hjust=) # size is in points | |
# ticks | |
axis.ticks = theme_segment() | |
axis.ticks.length = unit(0.3, "cm")) | |
axis.line | |
strip.background | |
strip.text.x | |
strip.text.y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment