[R] More than two font in a plot

baptiste auguie baptiste.auguie at googlemail.com
Wed Jun 30 11:20:14 CEST 2010


Hi,

Another option would be the tikzDevice package, which lets you process
all the text of your plot with LaTeX. I think the XeTeX variant might
be the most straight-forward to mix different fonts using this
approach.

HTH,

baptiste



On 29 June 2010 16:17, Jinsong Zhao <jszhao at mail.hzau.edu.cn> wrote:
> Hi there,
>
> I am a Chinese R user. I hope to display Chinese character in a plot,
> and than save it in PostScript format. I have read the article titled
> "Non-Standard Fonts in PostScript and PDF Graphics", especially the
> section about CJK fonts. I also tried the code:
>
>> pdf("chinese.pdf", width=3, height=1)
>> grid.text("\u4F60\u597D", y=2/3, gp=gpar(fontfamily="CNS1"))
>> grid.text("is 'hello' in (Traditional) Chinese", y=1/3)
>> dev.off()
>
> however, it's not valid with postscript(). It seems that postscript()
> need to set family in postscirpt(..., family = "CNS1"). Then all the
> characters are in CJK font, and it's not what I hope to get. I hope the
> Latin character is displayed in Helvetica.
>
> Any suggestions? Thanks in advance!
>
> Regards,
> Jinsong
> --
> Jinsong Zhao, Ph.D.
> College of Resources and Environment
> Huazhong Agricultural University
> Wuhan 430070, P.R. China
> E-mail: jszhao at mail.hzau.edu.cn
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list