How do I identify what a default element of a ggplot2 theme is?

In particular, I am interested in axis.ticks.length.

library(tidyverse)
iris %>% 
  ggplot() +
  geom_point(aes(Sepal.Width, Sepal.Length)) 


iris %>% 
  ggplot() +
  geom_point(aes(Sepal.Width, Sepal.Length)) +
  theme(axis.ticks.length = unit(1, "lines"))

Created on 2023-06-20 with reprex v2.0.2

So the question I have is: how long are the default ticks in ggplot2 for theme_gray?

Hi @davidhodge931
You should be able to mine the output from this:

library(ggplot2)
theme_set(theme_gray))
theme_get()

Many of the sizes are specified in relative units specified by the rel() function.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.