[R] unicode only works with a second one

Greg Snow Greg.Snow at imail.org
Wed Apr 1 21:31:56 CEST 2009


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.108506944444444, -0.141059027777778, -0.1953125, -0.242332175925926, 
-0.285734953703704, -0.332754629629630, -0.365306712962963, -0.390625, 
-0.419560185185185, -0.43041087962963, -0.437644675925926, -0.441261574074074, 
-0.444878472222222, -0.452112268518518, -0.44849537037037, -0.444878472222222, 
-0.441261574074074, -0.426793981481481, -0.408709490740741, -0.390625, 
-0.368923611111111, -0.339988425925926, -0.318287037037037, -0.285734953703704, 
-0.253182870370370, -0.220630787037037, NA, 0, 0, 0.00361689814814814, 
0.047019675925926, 0.0795717592592593, 0.108506944444444, 0.141059027777778, 
0.1953125, 0.242332175925926, 0.285734953703704, 0.332754629629630, 
0.365306712962963, 0.390625, 0.419560185185185, 0.43041087962963, 
0.437644675925926, 0.441261574074074, 0.444878472222222, 0.452112268518518, 
0.44849537037037, 0.444878472222222, 0.441261574074074, 0.426793981481481, 
0.408709490740741, 0.390625, 0.368923611111111, 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.snow at imail.org
801.408.8111


> -----Original Message-----
> From: Thomas Steiner [mailto:finbref.2006 at gmail.com]
> Sent: Tuesday, March 31, 2009 4:07 PM
> To: Jim Lemon; Greg Snow
> Cc: r-help at 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.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
> >




More information about the R-help mailing list