I'd like to paste a zodiac sign on a graph, but it only prints it when I add another unicode ( \u3030) to the desired \u2648 - why? See the examplecode (compare the orange with the skyblue): plot(c(-1,1),c(-4,-2),type="n") text(x=0,y=-3.0,labels="\u2648 \u3030",cex=2.3,col="skyblue") text(x=0,y=-3.2,labels="\u2648",cex=2.3,col="orange") zodiac=c("\u2642 \u2643 \u2644 \u2645 \u2646 \u2647 \u2648 \u2649 \u2650 \u2651 \u2652 \u2653") text(x=0,y=-3.5,labels=paste(zodiac,"\u3030"),cex=2.3,col="navy") I use R version 2.8.1 (2008-12-22) under MS Windows Vista. Thanks for help Thomas
I now tried a differnt R version under a drifferent OS, even worse: R version 2.9.0 alpha (2009-03-23 r48200) with Windwos XP does only show "\u2642". Do I need to install some fonts or so? Thanks Thomas 2009/3/28 Thomas Steiner <finbref.2006 at gmail.com>:> I'd like to paste a zodiac sign on a graph, but it only prints it when > I add another unicode ( \u3030) to the desired \u2648 - why? > See the examplecode (compare the orange with the skyblue): > > plot(c(-1,1),c(-4,-2),type="n") > text(x=0,y=-3.0,labels="\u2648 \u3030",cex=2.3,col="skyblue") > text(x=0,y=-3.2,labels="\u2648",cex=2.3,col="orange") > zodiac=c("\u2642 \u2643 \u2644 \u2645 \u2646 \u2647 \u2648 \u2649 > \u2650 \u2651 \u2652 \u2653") > text(x=0,y=-3.5,labels=paste(zodiac,"\u3030"),cex=2.3,col="navy") > > I use R version 2.8.1 (2008-12-22) under MS Windows Vista. > Thanks for help > Thomas >
I don't know how to help with the Unicode issue, but one alternative is the my.symbols function in the TeachingDemos package (see ?ms.male as well as ?my.symbols). Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Thomas Steiner > Sent: Saturday, March 28, 2009 9:19 AM > To: r-help at stat.math.ethz.ch > Subject: [R] unicode only works with a second one > > I'd like to paste a zodiac sign on a graph, but it only prints it when > I add another unicode ( \u3030) to the desired \u2648 - why? > See the examplecode (compare the orange with the skyblue): > > plot(c(-1,1),c(-4,-2),type="n") > text(x=0,y=-3.0,labels="\u2648 \u3030",cex=2.3,col="skyblue") > text(x=0,y=-3.2,labels="\u2648",cex=2.3,col="orange") > zodiac=c("\u2642 \u2643 \u2644 \u2645 \u2646 \u2647 \u2648 \u2649 > \u2650 \u2651 \u2652 \u2653") > text(x=0,y=-3.5,labels=paste(zodiac,"\u3030"),cex=2.3,col="navy") > > I use R version 2.8.1 (2008-12-22) under MS Windows Vista. > Thanks for help > Thomas > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code.
Hi Thomas, I get the zodiac symbols okay without the trailing \u3030 on FC9 Linux and R-2.8.1. Perhaps it's only on Windows. Might try it at work tomorrow where I can boot into WinXP. Jim
Thanks for the feedback. I did now try Vista (2.8.1), XP (2.9.0alpha) and Win2000 (2.8.1) and non did work compeletely, only on Vista/2.8.1 I got some symbols if I add the other sign. I will try the my.symbols later today, when i am at home. Thomas
unfortunately in my.symbols there are no zodiac signs, so I have to choose unicode which does not work for me yet. Thomas 2009/3/31 Thomas Steiner <finbref.2006 at gmail.com>:> Thanks for the feedback. > I did now try Vista (2.8.1), XP (2.9.0alpha) and Win2000 (2.8.1) and > non did work compeletely, only on Vista/2.8.1 I got some symbols if I > add the other sign. I will try the my.symbols later today, when i am > at home. > Thomas >
Hi Thomas Steiner wrote:> unfortunately in my.symbols there are no zodiac signs, so I have to > choose unicode which does not work for me yet.Another workaround is to use the Hershey fonts. For example ... plot(c(-1,1),c(-4,-2),type="n") text(x=0, y=-3.0, "\\VE \\MA", family="HersheySerif", cex=2) ... though they may not look terribly flash on screen. Paul> Thomas > > > 2009/3/31 Thomas Steiner <finbref.2006 at gmail.com>: >> Thanks for the feedback. >> I did now try Vista (2.8.1), XP (2.9.0alpha) and Win2000 (2.8.1) and >> non did work compeletely, only on Vista/2.8.1 I got some symbols if I >> add the other sign. I will try the my.symbols later today, when i am >> at home. >> Thomas >> > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 paul at stat.auckland.ac.nz http://www.stat.auckland.ac.nz/~paul/
Hi Greg and Paul, I tried several things, but I did not succeed: * I could not find the library(EBImage) on CRAN in Austria to open an png image in R. * I could not import the image via pixmap (read.pnm) as described on http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-misc:translucency because my GIMP cannot write pnm format. * I could not manage use the 'grImport' package to trace the svg:> readPicture("Aries.svg")Fehler in readPicture("Aries.svg") : Version mismatch: RGML file needs to be recreated with PostScriptTrace() * I gave up modifiying the svg code from wikipedia to make it an R array (structure) as you greg described it above. If you have any hint for me please let me know. I am willing to contribute something to TeachingDemos (although I am not sure if this is not a license problem as I trace the (public domain) images from wikimedia. Otherwise I am happy with the Hershey fonts so far. Thomas