简体   繁体   English

corrplot:更改为新的罗马corrplot()输出的时间

[英]corrplot: Changing to times new roman corrplot() output

I've like to create an image using corrplot() function in corrplot package in times new roman without success. 我想在新罗马时代使用corrplot包中的corrplot()函数创建图像,但没有成功。 I try to use par(family="Times"), but doesn't work and in help of the function don't have font type control. 我尝试使用par(family =“ Times”),但不起作用,并且在该功能的帮助下没有字体类型控制。 I try to make: 我尝试使:

library(corrplot)
data(mtcars)
M <- cor(mtcars)
## plot
par(family="Times")
corrplot(M, method = "number", col = "black", cl.pos = "n")
#

Please, any ideas? 拜托,有什么想法吗? Thanks 谢谢

I'm not sure it will work but I think this post will help you : 我不确定是否可以,但是我认为这篇文章对您有帮助:

Changing fonts in ggplot2 更改ggplot2中的字体

It will not help you but it is a really good post on font for R so I leave it on my answer. 它不会帮助您,但是它是R字体的不错的文章,所以我将其留在答案上。

Are you on windows or unix ? 您在Windows还是Unix上? If you are on windows this following answer will help you, if not I don't know. 如果您在Windows上,以下答案将为您提供帮助,如果不是,我不知道。

The problem is just coming from the fact that you are using Times wherease it is Times New Roman needed. 问题仅源于您正在使用Times的事实,因此需要Times New Roman

You can check it with the following line of code : 您可以使用以下代码行进行检查:

windowsFonts()
par(family="Times New Roman")
corrplot(M, method = "number", col = "black", cl.pos = "n")

In fact TT is the first letter of TrueType and it is common for all fonts. 实际上,TT是TrueType的首字母,并且对于所有字体都是通用的。 If you want a specific font you should not use TT. 如果您想要特定的字体,则不应使用TT。 See : 见:

https://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/windowsFonts.html https://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/windowsFonts.html

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

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