简体   繁体   中英

What are the default ggplot2 plot margins?

I cannot find information on this anywhere. I know how to set them but want to know the defaults (top, right, bottom, and left) so its less of a guessing game when setting margins for a plot.

For plot margins as well as other parameters, the default values are that of theme_grey :

theme_grey()$plot.margin
[1] 5.5pt 5.5pt 5.5pt 5.5pt

However, the default theme might change in the future, and you can set a different one (with theme_set() ) so a more robust way would be to use theme_get() which returns the current theme (@r2evans comment)

theme_get()$plot.margin 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM