Skip to content
Back to formatted view

Raw Message

Message-ID: <50B789C8.90408@stats.ox.ac.uk>
Date: 2012-11-29T16:14:00Z
From: Brian Ripley
Subject: How to handle Chinese [It seems Cyrillic] character in R plot?
In-Reply-To: <1354178528792-4651262.post@n4.nabble.com>

Your subject line says Chinese!

On 29/11/2012 08:42, Manish Gupta wrote:
> Hi,
>
> I m working on R plot with Russian label but on windows (adobe) russian text
> are not visible. Do i need to install some package to view it.
>
>   pdf("sample.pdf",width = 6.6 ,height = 4.2,family= "URWHelvetica",
> encoding="KOI8-R")
>   x<-c(1,2,3,4,5)
>   y<-c(2,3,4,5,6)
>   xlable<-c("?????","?????","????","?????","????????")
>   plot(x,y,xlab=xlable)
>   dev.off()

See ?pdf:

      If you see problems with PDF output, do remember that the problem
      is much more likely to be in your viewer than in R.  Try another
      viewer if possible.

The fonts include with the Adobe viewers do not cover Cyrillic (as the 
help in fact says).  It does work in poppler-based and gs-based viewers.

It is possible that you need to install a suitable language pack for 
your unstated Adobe viewer.

There are other devices for pdf, as the help says.  Seem if cairo_pdf() 
works on Windows.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595