[R] How to draw a per mille symbol?
Gavin Simpson
gavin.simpson at ucl.ac.uk
Tue Sep 19 18:29:40 CEST 2006
Dear list,
Following advice posted to this list a while back by Prof Ripley [1], I
have been trying to draw a per mille character [2] in an axis label.
This should give the correct character:
plot(1:10, ylab = "\u2030")
but all I get is '"S'. I'm running linux (FC5) and have fonts installed
that have the correct character (viewed in the Gnome character map at
least).
I have also tried plotting to a pdf device with a font family that the
character map tool shows I have a per mille glyph for, e.g.:
pdf("~/tmp/test_per_mille.pdf", paper = "a4", family = "URWBookman")
plot(1:10, ylab = "\u2030")
dev.off()
But all I get here is a period or a dot-like symbol.
I've tried this in R 2.4.0 alpha [4] and R 2.5.0 to be [4] as my
self-compiled R 2.3.1-patched dies when plotting Unicode characters
(fixed in 2.4.0 alpha and above [3])
Can anyone point me in the right direction to get this working?
TIA,
G
[1] http://finzi.psych.upenn.edu/R/Rhelp02a/archive/48709.html
[2] like a "%" but with 2 circles at the bottom not one, see
http://en.wikipedia.org/wiki/Permille
[3] see thread at http://article.gmane.org/gmane.comp.lang.r.devel/9704
[4] R version 2.4.0 alpha (2006-09-19 r39410)
[5] R version 2.5.0 Under development (unstable) (2006-09-19 r39410)
--
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Gavin Simpson [t] +44 (0)20 7679 0522
ECRC & ENSIS, UCL Geography, [f] +44 (0)20 7679 0565
Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/
UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
More information about the R-help
mailing list