How to Find the Default ggplot2 Plot Margins in R (Example Code)

In this R programming tutorial you’ll learn how to find the default ggplot2 plot margins.

Example: Printing the Default Margins of a ggplot2 Graphic Using the theme_get() Function

install.packages("ggplot2")    # Install ggplot2 package
library("ggplot2")             # Load ggplot2
theme_get()$plot.margin        # Get default ggplot2 margins
# [1] 5.5points 5.5points 5.5points 5.5points

Related Tutorials & Further Resources

You may find some additional R programming tutorials below.

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed