• Skip to secondary menu
  • Skip to main content
  • Skip to primary sidebar

Python and R Tips

Learn Data Science with Python and R

  • Home
  • Python
  • Pandas
    • Pandas 101
  • tidyverse
    • tidyverse 101
  • R
  • Linux
  • Conferences
  • Python Books
  • About
    • Privacy Policy
You are here: Home / R / ggplot2 / ggplot2 themes / 8 ggplot themes to make your plots look great

8 ggplot themes to make your plots look great

October 15, 2019 by cmdlinetips

ggplot2 is awesome. It enables people to easily make high quality data visualization plots. However, people who spent a lot of time with ggplot2 have love/hate relationship with the default ggplot2 theme, where a plot is on a grey background. The default ggplot2 theme is called theme_grey() or theme_gray(). In addition to the default theme, ggplot2 to has 7 other themes that can elevate your graphics. Here we will look at all 8 themes that are readily available with ggplot. One of my favorites is theme_bw() or theme_classic(). Learn these 8 ggplot2 themes and find out which is your favorite.

Let us use gapminder data to make a scatter plot and save the ggplot object. We will use the ggplot object in our examples with the themes for ggplot.

head(gapminder)
p_obj <- gapminder %>% 
  sample_n(200) %>%
  ggplot(aes(x=lifeExp, y=gdpPercap)) + 
  geom_point(alpha=0.5)+
  scale_y_log10()  
p_obj

1. theme_gray()

The default theme of ggplot is grey. We can also specify grey theme with grey_theme() and add it as a layer.

grey <- p_obj +theme_gray() +labs(subtitle = "theme_gray()")
grey
ggplot theme grey example
ggplot theme grey example

2. theme_bw()

bw <- p_obj +theme_bw()+labs(subtitle = "theme_bw()")
bw
ggplot theme_bw() example
ggplot theme_bw()

3. theme_classic()

classic <- p_obj + theme_classic() +labs(subtitle = "theme_classic()")
classic
ggplot theme_classic()
ggplot theme_classic()

4. theme_dark()

dark <- p_obj + theme_dark() +labs(subtitle = "theme_dark()")
dark
ggplot theme dark example
ggplot theme dark example

5. theme_light()

light <- p_obj + theme_light() + labs(subtitle = "theme_light()")
light
ggplot theme_light()
ggplot theme_light()

6. theme_linedraw()

linedraw <- p_obj + theme_linedraw() +labs(subtitle = "theme_linedraw()")
linedraw
ggplot theme_linedraw()
ggplot theme_linedraw()

7. theme_minimal()

minimal <- p_obj + theme_minimal() +labs(subtitle = "theme_minimal()")
minimal
ggplot theme_minimal()
ggplot theme_minimal()

8. theme_void()

void <- p_obj + theme_void()+labs(subtitle = "theme_void()")
void
ggplot theme_void()
ggplot theme_void()
library(gridExtra)
grid.arrange( grey, bw, light, dark, classic,linedraw, minimal, void, ncol=2)

Share this:

  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on X (Opens in new window) X

Related posts:

Scatter plot tips: Color & Shape by variable9 Tips to Make Better Scatter Plots with ggplot2 in R ggplot2 change legend title with guides()How To Change Legend Title in ggplot2? Default Thumbnailggplot2 Version 3.0.0 Brings Tidy Evaluation to ggplot Add Tags to combined plot: Patchwork7 Tips to Combine Multiple ggplots Using Patchwork

Filed Under: ggplot2 themes Tagged With: ggplot themes

Primary Sidebar

Subscribe to Python and R Tips and Learn Data Science

Learn Pandas in Python and Tidyverse in R

Tags

Altair Basic NumPy Book Review Data Science Data Science Books Data Science Resources Data Science Roundup Data Visualization Dimensionality Reduction Dropbox Dropbox Free Space Dropbox Tips Emacs Emacs Tips ggplot2 Linux Commands Linux Tips Mac Os X Tips Maximum Likelihood Estimation in R MLE in R NumPy Pandas Pandas 101 Pandas Dataframe Pandas Data Frame pandas groupby() Pandas select columns Pandas select_dtypes Python Python 3 Python Boxplot Python Tips R rstats R Tips Seaborn Seaborn Boxplot Seaborn Catplot Shell Scripting Sparse Matrix in Python tidy evaluation tidyverse tidyverse 101 Vim Vim Tips

RSS RSS

  • How to convert row names to a column in Pandas
  • How to resize an image with PyTorch
  • Fashion-MNIST data from PyTorch
  • Pandas case_when() with multiple examples
  • An Introduction to Statistical Learning: with Applications in Python Is Here
  • 10 Tips to customize ggplot2 title text
  • 8 Plot types with Matplotlib in Python
  • PCA on S&P 500 Stock Return Data
  • Linear Regression with Matrix Decomposition Methods
  • Numpy’s random choice() function

Copyright © 2025 · Lifestyle Pro on Genesis Framework · WordPress · Log in

Go to mobile version