如何在R中输出中文PDF
方法一:
library(Cairo);
CairoPDF();
plot(1:10,1:10,type="n");
text(2,10,"宋体",family="SimSun");
text(2,8,"黑体",family="SimHei");
text(2,6,"楷体",family="KaiTi_GB2312");
text(2,4,"隶书",family="LiSu");
text(2,2,"幼圆",family="YouYuan");
text(6,10,"Arial",family="Arial");
text(6,8,"Times New Roman",family="Times New Roman");
text(6,6,"Courier New",family="Courier New");
text(6,4,"Consolas",family="Consolas");
text(6,2,"Symbol",family="Symbol");
dev.off();
方法二:
pdf(family='GB1',file='xxx.pdf' )
plot(1:10,1:10,main='测试中文')
dev.off()