I forked the ggthemes
git repo to make my own custom theme. I've figured out how to do almost everything I need, but have one hang up.
I am specifically trying to set the default size
for geom_line()
in my ggtheme.
Where I'm at now, I have to do something like this:
economics %>%
ggplot(aes(date, uempmed)) +
geom_line(size = 1.75) +
theme_mycustomtheme()
When I would prefer to just have to do this:
economics %>%
ggplot(aes(date, uempmed)) +
geom_line() +
theme_mycustomtheme() # this would set the line size automatically
I have edited my mycustomtheme.R file like so:
theme(
# Elements in this first block aren't used directly, but are inherited
# by others
line = element_line(
color = "black", size = 1.75,
linetype = 1, lineend = "butt"
)
Note how the size is now set to 1.75. But it doesn't seem to make a difference when I call the theme in practice.
I would appreciate any pointers as to what I may be doing wrong. Thanks!