[R] Decimal point as a comma in postcript and pdf graphics

Greg Snow greg.snow at ihc.com
Wed Mar 9 17:23:44 CET 2005


>>>> Peter Dalgaard <p.dalgaard at biostat.ku.dk> 03/09/05 07:18AM >>>
>Ronny Klein <ronny.klein at wiwi.uni-halle.de> writes:
>
>> Hi,
>> 
>> after a lengthy but unsuccessfull search I couldn't come up with a
solution to 
>> the following problem:
>> 
>> I would like to have a "comma" instead of a "point" as the decimal
point in my 
>> graphics, i.e. postscript and pdf files, for I write my thesis in
German. My 
>> system is:
>> 
>> OS: Debian Unstable
>> R-Version:  2.0.1
>> System locale: de_DE at euro
>> 
>> Could someone, please, help me out or at least point me to the right

>> documentation. I'm just lost at the moment.
>
>
>We don't have a way of formatting numbers according to LC_NUMERIC, as
>far as I know. This leaves it to you to set up axes etc. to your
>liking, e.g.
>
> x <- rnorm(100,,.2)
> p <- pretty(x)
> hist(x,xaxt="n")
> axis(1, at=p, labels=sub("\\.", ",", p))

or for the last line:

axis(1, at=p, labels=format(p, decimal.mark=','))


>
>(and possibly throw in xlim=range(p) on the hist() call. Or use
>axTicks(), which is probably a better idea.)
>
>> Ronny
>> 
>> 
>> PS: The problem of displaying the German umlauts, I have already
solved: I 
>> have to use the WinAnsi.enc as the default encoding file. Which is
odd in my 
>> opinion.
>
>This should improve in 2.1.0 (or at least be broken in new and
>interesting ways) due to support for UTF-8 encodings.



Greg Snow, Ph.D.
Statistical Data Center
greg.snow at ihc.com
(801) 408-8111




More information about the R-help mailing list