Re: [R] unicode only works with a second one

2009-04-05 Thread Thomas Steiner
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

__
R-help@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.


Re: [R] unicode only works with a second one

2009-04-05 Thread David Winsemius

It's in the Bioconductor repository.

http://bioconductor.org/packages/2.3/bioc/html/EBImage.html


On Apr 5, 2009, at 6:14 AM, Thomas Steiner wrote:


EBImage


David Winsemius, MD
Heritage Laboratories
West Hartford, CT

__
R-help@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.


Re: [R] unicode only works with a second one

2009-04-05 Thread Paul Murrell
Hi


Thomas Steiner wrote:
 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()


Yep, you need to convert to PostScript (ImageMagick or InkScape ought to
do it) before you can import it.  See
http://www.stat.auckland.ac.nz/~paul/R/grImport/import.pdf
for a thorough description of how the package works.

Paul


 * 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

-- 
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
p...@stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/

__
R-help@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.


Re: [R] unicode only works with a second one

2009-04-01 Thread Greg Snow
One of the points of my.symbols is that you can define your own symbols to use 
with it (hence the my).

I downloaded a graphic of the aries symbol (your original attempt in unicode I 
belive) and used the following code to trace the left half of the symbol 
(starting bottom center), then used that to create a matrix for the aries 
symbol:

library(EBImage)
tmp - chooseImage()
image(tmp)

library(TeachingDemos)
tmp2 - par('usr')
updateusr(tmp2[1:2], tmp2[3:4], c(-1,1), c(-1,1))

out1 - locator(type='l', col='red', lwd=3)

out1$x - out1$x - out1$x[1]
ms.aries - rbind( cbind( out1$x, out1$y), NA, cbind( -out1$x, out1$y ) )

this resulted in the matrix:

ms.aries - 
structure(c(0, 0, -0.00361689814814814, -0.047019675925926, 
-0.0795717592592593, 
-0.1085069, -0.14105902778, -0.1953125, -0.242332175925926, 
-0.285734953703704, -0.332754629629630, -0.365306712962963, -0.390625, 
-0.419560185185185, -0.43041087962963, -0.437644675925926, -0.441261574074074, 
-0.44487847222, -0.452112268518518, -0.44849537037037, -0.44487847222, 
-0.441261574074074, -0.426793981481481, -0.408709490740741, -0.390625, 
-0.3689236, -0.339988425925926, -0.318287037037037, -0.285734953703704, 
-0.253182870370370, -0.220630787037037, NA, 0, 0, 0.00361689814814814, 
0.047019675925926, 0.0795717592592593, 0.1085069, 0.14105902778, 
0.1953125, 0.242332175925926, 0.285734953703704, 0.332754629629630, 
0.365306712962963, 0.390625, 0.419560185185185, 0.43041087962963, 
0.437644675925926, 0.441261574074074, 0.44487847222, 0.452112268518518, 
0.44849537037037, 0.44487847222, 0.441261574074074, 0.426793981481481, 
0.408709490740741, 0.390625, 0.3689236, 0.339988425925926, 
0.318287037037037, 0.285734953703704, 0.253182870370370, 0.220630787037037, 
-0.534428351808399, -0.453515656606522, 0.254470426409904, 0.307063678291124, 
0.35561129541225, 0.387976373493001, 0.40820454729347, 0.432478355854034, 
0.448660894894409, 0.436523990614127, 0.420341451573752, 0.404158912533376, 
0.375839469212719, 0.339428756371875, 0.298972408770936, 0.262561695930091, 
0.246379156889716, 0.214014078808965, 0.185694635488308, 0.157375192167651, 
0.120964479326806, 0.0885994012460556, 0.0602799579253985, 0.0238692450845536, 
-0.000404563476009408, -0.0246783720365727, -0.0449065458370419, 
-0.0570434501173234, -0.0732259891576988, -0.0772716239177927, 
-0.0772716239177927, NA, -0.534428351808399, -0.453515656606522, 
0.254470426409904, 0.307063678291124, 0.35561129541225, 0.387976373493001, 
0.40820454729347, 0.432478355854034, 0.448660894894409, 0.436523990614127, 
0.420341451573752, 0.404158912533376, 0.375839469212719, 0.339428756371875, 
0.298972408770936, 0.262561695930091, 0.246379156889716, 0.214014078808965, 
0.185694635488308, 0.157375192167651, 0.120964479326806, 0.0885994012460556, 
0.0602799579253985, 0.0238692450845536, -0.000404563476009408, 
-0.0246783720365727, -0.0449065458370419, -0.0570434501173234, 
-0.0732259891576988, -0.0772716239177927, -0.0772716239177927
), .Dim = c(63L, 2L))

Which can be used as:

my.symbols(1:10,1:10, ms.aries, add=FALSE, inches=0.3, lwd=2)

If aries is the only one that you need, just use the above matrix, if you need 
others, you can follow the above steps to trace out the other symbols (just 
remember to put in a row of NA everywhere you want a jump without connecting 
line).

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


 -Original Message-
 From: Thomas Steiner [mailto:finbref.2...@gmail.com]
 Sent: Tuesday, March 31, 2009 4:07 PM
 To: Jim Lemon; Greg Snow
 Cc: r-help@r-project.org
 Subject: Re: [R] unicode only works with a second one
 
 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.2...@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@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.


Re: [R] unicode only works with a second one

2009-04-01 Thread Thomas Steiner
Hi,
thanks for all your hints.

 One of the points of my.symbols is that you can define your own symbols to 
 use with it (hence the my).

I tried this and it works fine. I need all the symbols and I will
probably not trace them, but copy the svg code and modify them from
http://commons.wikimedia.org/wiki/Zodiac
I will do this on the weekend.

 Paul:
 Another workaround is to use the Hershey fonts.  For example ...

\\VE \\MA work fine, but I need all twelve zodiac symbols.

Thomas

__
R-help@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.


Re: [R] unicode only works with a second one

2009-03-31 Thread Jim Lemon

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

__
R-help@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.


Re: [R] unicode only works with a second one

2009-03-31 Thread Thomas Steiner
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@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.


Re: [R] unicode only works with a second one

2009-03-31 Thread Thomas Steiner
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.2...@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@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.


Re: [R] unicode only works with a second one

2009-03-31 Thread Paul Murrell
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.2...@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@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
p...@stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/

__
R-help@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.


Re: [R] unicode only works with a second one

2009-03-30 Thread Greg Snow
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.s...@imail.org
801.408.8111


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
 project.org] On Behalf Of Thomas Steiner
 Sent: Saturday, March 28, 2009 9:19 AM
 To: r-h...@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@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.

__
R-help@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.


[R] unicode only works with a second one

2009-03-28 Thread Thomas Steiner
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@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.


Re: [R] unicode only works with a second one

2009-03-28 Thread Thomas Steiner
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.2...@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


__
R-help@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.


Re: [R] unicode only works with a second one

2009-03-28 Thread Thomas Steiner
I forgot to ad some info:

 sessionInfo()
R version 2.9.0 alpha (2009-03-23 r48200)
i386-pc-mingw32

locale:
LC_COLLATE=German_Austria.1252;LC_CTYPE=German_Austria.1252;LC_MONETARY=German_Austria.1252;LC_NUMERIC=C;LC_TIME=German_Austria.1252

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base


and from http://www.mail-archive.com/r-help@r-project.org/msg44163.html
I learned that it depends on my runing OS / installation. I know that
this is not an R question, but I have no idea how to proceed...

Thomas


2009/3/29 Thomas Steiner finbref.2...@gmail.com:
 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.2...@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



__
R-help@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.