r – 在Windows vs Mac上更改ggplot2中的字体
发布时间:2020-12-14 04:14:30 所属栏目:Windows 来源:网络整理
导读:我在我的mac上使用ggplot2创建了一个情节.我将字体更改为Times New Roman,效果很好. library(extrafont)ggplot(data=df)+ stat_density(aes(x=R1,colour="rho = -0,6"),adjust=4,lwd=0.65,geom="line",position="identity")+ stat_density(aes(x=R2,colour="
我在我的mac上使用ggplot2创建了一个情节.我将字体更改为Times New Roman,效果很好.
library(extrafont) ggplot(data=df)+ stat_density(aes(x=R1,colour="rho = -0,6"),adjust=4,lwd=0.65,geom="line",position="identity")+ stat_density(aes(x=R2,colour="rho = 0,position="identity")+ stat_density(aes(x=R3,colour="rho = 0"),linetype=2,position="identity")+ xlim(-1,1)+ xlab("Renditen")+ ylab("Dichte")+ ggtitle("Renditeverteilung im Heston-Modell")+ theme(plot.title=element_text(face="bold",size=16,vjust=2,family="Times New Roman"),axis.title.x=element_text(vjust=-1,size=14,axis.title.y=element_text(vjust=-0.25,legend.text=element_text(size=14,legend.title=element_blank(),legend.margin=unit(1,"cm"),legend.key.height=unit(1,"line"),legend.key.size=unit(0.8,legend.key=element_rect(fill=NA),legend.background=element_blank(),plot.margin=unit(c(1,1,1),"cm"))+ scale_colour_manual(values=c("red","black","blue"),labels=greeks_rho)+ guides(colour=guide_legend(override.aes=list(linetype=c(1,3,1)))) 这是Mac上的结果: 我需要以WMF格式导出绘图,所以我在Windows上使用R Studio,我无法将字体更改为Times New Roman.除了上面的代码之外我还做了以下内容但没有成功. library(extrafont) font_import() loadfonts() 我得到这样的警告(英文:?“在Windows字体数据库中找不到字体系列”) 47: In grid.Call.graphics(L_text,as.graphicsAnnot(x$label),... : Zeichensatzfamilie in der Windows Zeichensatzdatenbank nicht gefunden 这是Windows上的结果: 并且:为什么Mac上的图形线看起来比在Windows上要平滑得多? 有人可以帮忙吗?谢谢!
在渲染绘图之前使用loadfonts(device =“win”)而不仅仅是loadfonts(),对我有用.我不确定为什么后者(或根本没有调用)足以在OS X上运行;我只能假设某种默认设备正在发生.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- windows-server-2012-r2 – 为什么我得到服务器2012R2的办公
- powershell – 在Nano Server上运行Service Fabric
- windows-server-2008 – 如何将现有的Windows Server 2008
- .net – DataTemplate中的TemplateBinding不起作用
- windows – 如何编写检查openGL支持的安装程序?
- windows-phone-8.1 – Windows Phone 8.1中按钮的最小尺寸
- WPF:找不到Microsoft_Windows_Themes
- windows-phone-8 – 如何获取推送通知的Windows Phone设备令
- 命令行 – 导致xcopy告诉我访问被拒绝的原因是什么?
- 拒绝服务 – 阻止IP地址,防止DoS攻击
推荐文章
站长推荐
- windows-server-2008 – 如何在IIS7 / Win2008服
- DLL – 升级到1.1.0后无法加载文件或程序集“Mic
- 如何以编程方式确定用户帐户是否是Windows中特定
- 老机器XP Outlook Express 发大附件对方客户端收
- 如何将uint32_t转换为struct in_addr?
- windows – Xampp – 安装SQL Server和Visual St
- 窗口管理器 – Awesome wm的“Fn”键名称是什么?
- Windows – IIS不再信任任何CA进行客户端身份验证
- windows-server-2008 – 如何从自己的计算机上锁
- windows – 如何打开新的cmd窗口并在其中执行for
热点阅读