简体   繁体   English

如何使用R更改箱形图中的字体类型和大小

[英]How can I change font type and size in a boxplot with R

I'm a beginner in R , and I'm trying to create a set of plots but the output must be Arial font size 8 . 我是R语言的初学者,我正在尝试创建一组绘图,但是输出必须为Arial字体大小8

I've tried several approaches but none of them works. 我尝试了几种方法,但没有一种有效。

I'm using a simple code such as: 我正在使用一个简单的代码,例如:

boxplot(dados_final$ytot.n ~ dados_final$ano.f, col = "lightblue", xlab = "Ano", ylab = "Score", main = "Evolution", border = "darkblue")

Could you please help? 能否请你帮忙?

Thanks in advance for your time. 在此先感谢您的时间。

You could use par() as follows: 您可以使用par()如下:

par(family = "Ariel Black")
boxplot(dados_final$ytot.n ~ dados_final$ano.f, col = "lightblue", xlab = "Ano", ylab = "Score", main = "Evolution", border = "darkblue")

Then the font of the plot will belong to the "Ariel" family 然后该情节的字体将属于“ Ariel”家族

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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