• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Data Viz with Python and R

Learn to Make Plots in Python and R

  • Home
  • Seaborn
  • Matplotlib
  • ggplot2
  • Altair
  • About
    • Privacy Policy
  • Visualizing Activation Functions in Neural Networks
  • Confusion Matrix Calculator
  • Visualizing Dropout Rate in Neural Network
  • Visualizing Loss Functions in Neural Networks
  • Show Search
Hide Search

How To Change ggplot2 theme?

datavizpyr · December 11, 2019 ·

Last updated on December 15, 2019

ggplot2 offers 8 themes for making plots using ggplot2. By default, ggplot2 uses the grey theme. Here, we will examples of how to change the plot theme from the default grey ggplot2 theme.

Let us first make a simple scatter plot with default grey ggplot theme
library(ggplot2)


Let us create data frame with two variables to make a scatter plot in default ggplot2 theme.

x <- rnorm(500, mean=65, sd=20)
y <- rnorm(500, mean=2, sd=20) - x
df <- data.frame(x=x, y=y)
Let us create a simple scatter plot with default grey theme.
df %>% 
  ggplot(aes(x=x,y=y)) + geom_point()
Let us change the default theme to a simple black and white theme. ggplot2 black and white theme is called theme_bw(). Let us make the scatter in ggplot theme_bw()
df %>% 
   ggplot(aes(x=x,y=y)) + geom_point()+  theme_bw()
ggplot black and white theme: theme_bw()

Explore the Complete ggplot2 Guide

35+ tutorials with code: scatterplots, boxplots, themes, annotations, facets, and more—tested and beginner-friendly.

Visit the ggplot2 Hub → No fluff—just code and visuals.

Related posts:

Dollar format ggplot2How to Add Dollar Symbol for Axis Labels with ggplot2? Customizing Labels on Bars in Side by side Stacked BarplotHow To Add Labels to Grouped Barplot with Bars Side-By-Side in R? Visualizing Missing Data with Barplot in R ggplot2Visualizing Missing Data with Barplot in R Annotate Clusters with Ellipse with Labels ggforceHow To Annotate Clusters with Circle/Ellipse by a Variable in R

Filed Under: ggplot2, ggplot2 theme, R Tagged With: ggplot2, R

Primary Sidebar

Python & R Viz Hubs

  • Seaborn Guide & Cookbook
  • ggplot2 Guide & Cookbook
  • Matplotlib Guide & Cookbook
  • Confusion Matrix Calculator
  • Visualizing Activation Functions
  • Visualizing Dropout
  • Visualizing Loss Functions

Buy Me a Coffee

Copyright © 2026 · Daily Dish Pro on Genesis Framework · WordPress · Log in

Go to mobile version