[R] how to let R support Chinese fonts in charts?

From: Samuel <samuel.yh.wu_at_gmail.com>
Date: Wed, 12 Mar 2008 15:48:01 +0800


Hi everyone,

I plotted a chart this morning, which should have Chinese lables for the points. I made the chart via:
coordinates:
angel77wq 360.61501 9.278135
cngdsthuang1220 -278.74068 91.556843

c国际米兰c       125.47369  -66.589461
fszym2007       -174.86150  346.672588
john_azyb_lee    -59.76965  -13.806237
limu0089        -135.18684 -147.573071
new枪手         -147.53176 -130.237810
ouyangye1215     103.64392 -154.077046
poleland          20.42025 -190.509781
一声不哭        -324.70414  300.982933
一脚抽射           6.99539 -102.055952
三天两句         674.25244  106.671916
九头斑马        -282.92130  -38.153908
伯纳乌南斗星    -115.72405 -263.611178
健哥傲视天下 -165.43261 -174.308852 八零后的天堂 -224.57776 332.793277
加泰的灵魂       139.53463   93.483387
劳尔冈萨累斯     -77.28240 -301.935448
四眉水手         627.93457  125.001091
国米露露         -72.13721  176.418576

label:

[1] "angel77wq" "cngdsthuang1220" "c国际米兰c" "fszym2007"
[5] "john_azyb_lee" "limu0089" "new枪手" "ouyangye1215"
[9] "poleland" "一声不哭" "一脚抽射" "三天两句"
[13] "九头斑马" "伯纳乌南斗星" "健哥傲视天下" "八零后的天堂"
[17] "加泰的灵魂" "劳尔冈萨累斯" "四眉水手" "国米露露"

plot(coordinates,type='n')
text(coordinates,labels)

and then I got the chart looks like the attached one.

I know should be the encoding problem,but I don't know where I can change it.

any ideas on this will be greatly appreciated.

Thanks in advance.

-- 
Samuel Wu
http://webclipping.com.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.

Received on Wed 12 Mar 2008 - 07:51:27 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 12 Mar 2008 - 09:30:20 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive