[S] setting fill colours in a legend

Mohamed Abdolell (abdolell@mshri.on.ca)
Thu, 21 May 1998 09:14:51 -0400


Thanks to the fantastic response from quite a number of people, I've
managed to produce color postscript files.

However, I've encountered another problem trying to match the points
colours with the legend colours!

Here's what I've done ...
----------------------------------------------------------------------
plot(sdate, sqr.p4, xlim=c(xmin, xmax), ylim=c(0, 1),
xlab="Surgery Date", ylab="Pred Probs", main="T-Status: Overall",
type="n", axes=F)
points(sdate[pred$tumcat.a==1], sqr.p1[pred$tumcat.a==1], col=5)
points(sdate[pred$tumcat.a==4], sqr.p4[pred$tumcat.a==4], col=23)
axis(1, at=date.integer, labels=year.char)
axis(2)

legend(10500, .9, c("slate blue", "yellow"), fill=c(5,23))
----------------------------------------------------------------------

The 'col=' option in the POINTS statement does what I expect, ploting
the correct colours defined by MYCOLORS matrix in the statement ...

ps.options.send(image.colors=mycolors, colors=mycolors,
black.and.white='false', background=-1)

> MYCOLORS
Red Green Blue
black 0.0000000 0.00000000 0.0000000
ivory 1.0000000 1.00000000 0.9411765
lavender 0.9019608 0.90196078 0.9803922
navy blue 0.0000000 0.00000000 0.5019608
slate blue 0.4156863 0.35294118 0.8039216
royal blue 0.2549020 0.41176471 0.8823529
blue 0.0000000 0.00000000 1.0000000
sky blue 0.5294118 0.80784314 0.9215686
turquoise 0.2509804 0.87843137 0.8156863
cyan 0.0000000 1.00000000 1.0000000
dark olive green 0.3333333 0.41960784 0.1843137
lawn green 0.4862745 0.98823529 0.0000000
forest green 0.1333333 0.54509804 0.1333333
indian red 0.8039216 0.36078431 0.3607843
salmon 0.9803922 0.50196078 0.4470588
orange 1.0000000 0.64705882 0.0000000
tomato 1.0000000 0.38823529 0.2784314
red 1.0000000 0.00000000 0.0000000
deep pink 1.0000000 0.07843137 0.5764706
maroon 0.6901961 0.18823529 0.3764706
violet 0.9333333 0.50980392 0.9333333
purple 0.6274510 0.12549020 0.9411765
yellow 1.0000000 1.00000000 0.0000000

However, the 'fill=' option in the LEGEND statement does not correspond
to the same colours as in the POINTS statement.

Again, any help would be very much appreciated.

PS - Many thanks to all who responded to my first inquiry regarding
colour postscript files;
Fang, Stephen Smith, Jonathan Wang, Mona Kanaan, and Phil Spector all
pointed to issues that ultimately needed some attention so that I
produce colour postscript files

I will post a summary of the responses and what ultimately worked for me
once i solve this current problem -- hopefully in another day or two.

-- 
           ,,, 
          (o o)                                       Mohamed Abdolell 
------oOO--(_)--OOo---------------------------------------------------
 Mount Sinai Hospital, Samuel Lunenfeld Research Institute
 850-600 University Ave. Toronto, Ontario, M5G 1X5, CANADA
 e-mail: abdolell@mshri.on.ca  voice: (416)586-8886 fax: (416)586-8404
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news