Hi, I am working on Chinese language plot. But names and labels are in chinese language. How can i print chineese characters as lable in R plot. ?? ? ?? ?? 2 2 ? 3 4 ? 4 2 ??? 5 6 ? 6 3 like we can do in excel as shown below in image. <http://r.789695.n4.nabble.com/file/n4645950/Screenshot.png> Regards -- View this message in context: http://r.789695.n4.nabble.com/How-to-handle-Chinese-character-in-R-plot-tp4645950.html Sent from the R help mailing list archive at Nabble.com.
On 2012-10-12 10:16, Manish Gupta wrote:> Hi, > > I am working on Chinese language plot. > > But names and labels are in chinese language. How can i print chineese > characters as lable in R plot. > > > ?? ? ?? > ?? 2 2 > ? 3 4 > ? 4 2 > ??? 5 6 > ? 6 3 > > like we can do in excel as shown below in image. > <http://r.789695.n4.nabble.com/file/n4645950/Screenshot.png> > > Regards >try the following code: x <- read.csv(textConnection(" ??,?,?? ??,2,2 ?,3,4 ?,4,2 ???,5,6 ?,6,3"), header = TRUE) rownames(x) <- x[,1] x <- x[,-1] barplot(t(x), horiz = TRUE, beside = TRUE, legend.text = TRUE) HIH, Regards, Jinsong
But i need to read my data from XML. <barplot> <cd> <name>?</name> <value1>3</value1> <value2>2.9</value2> </cd> <cd> <name>?</name> <value1>3.3</value1> <value2>3</value2> </cd> <cd> <name>??</name> <value1>2.3</value1> <value2>2.9</value2> </cd> <cd> <name>?</name> <value1>3.4</value1> <value2>2.6</value2> </cd> <cd> <name>??</name> <value1>3.1</value1> <value2>2.4</value2> </cd> </barplot> Regards -- View this message in context: http://r.789695.n4.nabble.com/How-to-handle-Chinese-character-in-R-plot-tp4645950p4645958.html Sent from the R help mailing list archive at Nabble.com.
But i need to read my data from XML. <barplot> <cd> <name>?</name> <value1>3</value1> <value2>2.9</value2> </cd> <cd> <name>?</name> <value1>3.3</value1> <value2>3</value2> </cd> <cd> <name>??</name> <value1>2.3</value1> <value2>2.9</value2> </cd> <cd> <name>?</name> <value1>3.4</value1> <value2>2.6</value2> </cd> <cd> <name>??</name> <value1>3.1</value1> <value2>2.4</value2> </cd> </barplot> Regards -- View this message in context: http://r.789695.n4.nabble.com/How-to-handle-Chinese-character-in-R-plot-tp4645950p4645962.html Sent from the R help mailing list archive at Nabble.com.
I just founfd one article abt internationalisation of R. Can it be used here. <http://r.789695.n4.nabble.com/file/n4646206/image1.png> <http://r.789695.n4.nabble.com/file/n4646206/image2.png> How this can be helpful in plotting graphs in chineese language. Pls help me out as i m in great need. Regards -- View this message in context: http://r.789695.n4.nabble.com/How-to-handle-Chinese-character-in-R-plot-tp4645950p4646206.html Sent from the R help mailing list archive at Nabble.com.
I guess you are using Arch. I think it might be related to the fonts. Try to install good Chinese font such as ttf-wqy-zenhei. In my (debian) system, I have only installed this font and it plots in R without hiccups. On Wed, Oct 17, 2012 at 9:45 AM, Manish Gupta <mandecent.gupta at gmail.com> wrote:> Hi, > > > I also did the same what u suggested. > > >> sessionInfo() > R version 2.14.1 (2011-12-22) > Platform: x86_64-unknown-linux-gnu (64-bit) > > locale: > [1] LC_CTYPE=zh_CN.UTF-8 LC_NUMERIC=C > [3] LC_TIME=zh_CN.UTF-8 LC_COLLATE=zh_CN.UTF-8 > [5] LC_MONETARY=zh_CN.UTF-8 LC_MESSAGES=zh_SG.UTF-8 > [7] LC_PAPER=C LC_NAME=C > [9] LC_ADDRESS=C LC_TELEPHONE=C > [11] LC_MEASUREMENT=zh_SG.UTF-8 LC_IDENTIFICATION=C > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > loaded via a namespace (and not attached): > [1] XML_3.9-4 >> source("a.txt",encoding="UTF-8") > > But still same pblm is there. > > <http://r.789695.n4.nabble.com/file/n4646421/Screenshot.png> > > > > -- > View this message in context: http://r.789695.n4.nabble.com/How-to-handle-Chinese-character-in-R-plot-tp4645950p4646421.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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.