原文链接:http://tecdat.cn/?p=14987
预期
R语言绘图中的中文默认字体宋体,希望用其他字体绘图,保存成PDF格式不能识别中文。
实际
使用“雅黑字体”出现乱码
重现问题的步骤
Windows7系统,R ×64 3.2.0
代码语言:javascript复制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")
参考文献
1.如何解决线性混合模型中畸形拟合(SINGULAR FIT)的问题
2.在UBUNTU虚拟机上安装R软件包
3.WINDOWS中用命令行执行R语言命令
4.R语言GGSURVPLOT绘制生存曲线报错 : OBJECT OF TYPE ‘SYMBOL‘ IS NOT SUBSETTABLE