[R] foreign characters in R plots

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Aug 27 18:10:27 CEST 2001


On Mon, 27 Aug 2001, Jakub Fast wrote:

>
> > I've just tried
> >
> > postscript("latin2.ps", enc="ISOLatin2.enc")
> > par(pty="s")
> > plot(c(0,15), c(0,15), type="n", xlab="", ylab="")
> > title("Centred chars in ISO Latin2")
> > grid(15, 15, lty=1)
> > for(i in c(32:127, 160:255)) {
> >     x <- i %% 16
> >     y <- i %/% 16
> >     points(x, y, pch=i)
> > }
> >
> > and apart from some missing centering information it looks like
> > a table of ISO Latin2 I looked up.
>
> Thank you for the reply. However, as long as your code works perfectly
> (apart from centering, which you mentioned), I am still unable to get the
> characters for instance in axis labels. Here's what I do:
>
> postscript("test.ps", enc="ISOLatin2.enc")
> plot(somedata, log="xy" ..., xlab="Cz\234sto\182\230 wyst\234powania")
> dec.off()
>
> This way I get blanks instead of the characters and a couple of warning
> messages (~"character width unknown"). The characters do show up on your
> table. What am I doing wrong?

Octal  234 is decimal 156, and there is no character encoded there.
182 is not octal...

Did you think those escapes were decimal?  I got

Warning messages:
1: font width unknown for character 156
2: font width unknown for character 130
3: font width unknown for character 152
...

which might have given you a clue.

*You* should just be able to type those characters on a Polish keyboard,
at least if it is generating what my tables think is latin2.

-- 
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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list