拓端tecdat|R语言作图不显示中文解决办法,如何使用中文字体
发布时间:2022-11-17 03:49:21 342
相关标签: # windows# 数据
预期
R语言绘图中的中文默认字体宋体,希望用其他字体绘图,保存成PDF格式不能识别中文。
实际
使用“雅黑字体”出现乱码
重现问题的步骤
Windows7系统,R ×64 3.2.0
- windowsFonts(
- + A=windowsFont("华文彩云"),
- + B=windowsFont("华文仿宋"),
- + C=windowsFont("华文行楷"),
- + D=windowsFont("华文楷体"),
- + E=windowsFont("华文隶书"),
- + F=windowsFont("华文中宋"),
- + G=windowsFont("华文细黑"),
- + H=windowsFont("微软雅黑"),
- + J=windowsFont("华文新魏"),
- + K=windowsFont("幼圆")
- + )
- plot(1:10,1:10,type="n")
- text(2,10,"华文彩云",family="A");
- text(2,8,"华文仿宋",family="B");
- text(2,6,"华文行楷",family="C");
- text(2,4,"华文楷体",family="D");
- text(2,2,"幼圆",family="K");
- text(6,10,"华文隶书",family="E")
- text(6,8,"华文中宋",family="F")
- text(6,6,"华文细黑",family="G")
- text(6,4,"微软雅黑",family="H")
- text(6,2,"华文新魏",family="J")
文章来源: https://blog.51cto.com/u_14293657/5850641
特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报