如何在R中的绘图中增加字体大小? [英] How to increase font size in a plot in R?

查看:79
本文介绍了如何在R中的绘图中增加字体大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很困惑.在绘图的标题、标签和其他位置增加文本字体大小的正确方法是什么?

I am confused. What is the right way to increase font size of text in the title, labels and other places of a plot?

例如

x <- rnorm(100)
hist(x, xlim=range(x), xlab= "Variable Label", 
     ylab="density", main="Title of plot", prob=TRUE, ps=30)

ps 参数不会改变字体大小(但它在 ?par 的 R 帮助中说它是文本的磅值(但不是符号)"".

The ps argument does not change font size (but it says in R Help for ?par that it is for "the point size of text (but not symbols)".

是否也可以将改变字体大小与hist等绘图功能分开?

Also is it possible to separate changing the font size from the plotting function such as hist?

推荐答案

您需要使用 cex=1.5 参数之类的东西来将字体缩放 150%.但是请参阅 help(par) 因为还有 cex.lab, cex.axis, ...

You want something like the cex=1.5 argument to scale fonts 150 percent. But do see help(par) as there are also cex.lab, cex.axis, ...

这篇关于如何在R中的绘图中增加字体大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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