Themes in ggplot2


New to Plotly?

Plotly is a free and open-source graphing library for R. We recommend you read our Getting Started guide for the latest installation or upgrade instructions, then move on to our Plotly Fundamentals tutorials or dive straight in to some Basic Charts tutorials.

Give complete themes which control all non-data display and then convert them with ggplotly.

p <- ggplot(mtcars, aes(mpg, wt)) +
  geom_point()
p
plotly::ggplotly(p)
p <- ggplot(mtcars, aes(mpg, wt)) +
  geom_point()
old <- theme_set(theme_bw())
p
plotly::ggplotly(p)
p <- ggplot(mtcars, aes(mpg, wt)) +
  geom_point()
old <- theme_set(theme_bw())
theme_set(old)
theme_update(panel.grid.minor = element_line(colour = "red"))
p
plotly::ggplotly(p)
p <- ggplot(mtcars, aes(mpg, wt)) +
  geom_point()
old <- theme_set(theme_bw())
theme_set(old)
theme_replace(panel.grid.minor = element_line(colour = "red"))
p
plotly::ggplotly(p)
p <- ggplot(mtcars, aes(mpg, wt)) +
  geom_point()
old <- theme_set(theme_bw())
theme_set(old)
p
plotly::ggplotly(p)