如何更改ggplot2中的默认字体大小 [英] How to change the default font size in ggplot2

查看:1750
本文介绍了如何更改ggplot2中的默认字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以为整个R会话更改 ggplot2 图形的某些默认参数,例如字体大小。这个想法是为了避免为每个情节设置它们。

解决方案

使用 theme_set()

  theme_set(theme_gray(base_size = 18))
qplot(1:10,1:10)

p>

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.

解决方案

Use theme_set()

theme_set(theme_gray(base_size = 18))
qplot(1:10, 1:10)

这篇关于如何更改ggplot2中的默认字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆