Skip to content
Back to formatted view

Raw Message

Message-ID: <507787ED.4080002@yeah.net>
Date: 2012-10-12T03:01:01Z
From: Jinsong Zhao
Subject: How to handle Chinese character in R plot?
In-Reply-To: <1350008194005-4645950.post@n4.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