Popular themes with ggthemes
What if you could set themes similar to the ones coming from FiveThirtyEight, The Economist, or the Wall Street Journal? Using the ggthemes
package, this is easy to achieve. There are a bunch of other themes available such as Stata, Excel, and Pander. This recipe's goal is to demonstrate how to generally assign some themes from this package.
Getting Ready
There are two requirements. In the first place, we need a ggplot
object to draw on; this recipe uses the bubble object created in the previous recipe. You can either make sure it's available on your environment by running that recipe or adapt this recipe by replacing bubble
with a ggplot
of your own. You also need to make sure that ggthemes
is properly installed:
> if(!require(ggthemes)){ install.packages('ggthemes')}
To the playground!
How to do it...
The following steps delineate how to proceed with the recipe:
- Load
ggthemes
and stacktheme_fivethirtyeight()
to reach for the FiveThirtyEight theme:
> library...