Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in R Programming by (7.3k points)

I'd like to know if it is possible to change some default parameters of ggplot2 graphics, like font size for instance, for a whole R session. The idea is to avoid setting them for each plot.

1 Answer

0 votes
by

To change the default font size in ggplot2, you can use the theme_set() function as follows:

theme_set(theme_gray(base_size = 15))

For example:

ggplot(mpg, aes(cty, hwy)) + geom_point()

Output:

image

Related questions

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...