pass options inside call to theme_void and similar

This appears to be a feature, are there reasons for the limitation? Options accepted by the theme() function cannot be passed to the theme_something() function.

This works:

my_ggplot +
theme_void() +
theme(legend.position = "none") 

But the option gets ignored here:

my_ggplot +
theme_void(legend.position = "none")

You can pass the base_size option, but that's it.

Shouldn't theme_void(legend.position = "none") return a warning or an error?

Yes, it should return an error. Specifically, the included complete themes accept 4 argument, and supplying another should yield an error and it does (at least for me, on v3.3.5):

ggplot() + theme_void(legend.position = "none")

Gives

Error in theme_void(legend.position = "none") : 
  unused argument (legend.position = "none")

Oh thanks, I must have had something else going on, I can see the error message now.

:ok_hand:

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.