[S] colour postscript files -- SUMMARY

Mohamed Abdolell (abdolell@mshri.on.ca)
Mon, 25 May 1998 10:58:57 -0400

Thanks to all who responded to my initial inquiry regarding creating
colour postscript files.
In particular, thanks to Stephen Smith, Tony Plate, Phil Spector, Fang
Xie, Mona Kanaan, and
Johnathan Wang.

First I followed the suggestion of Stephen Smith to INSTALL THE COLOUR
I had to work with the system administrator to do this before I could
determine if my Splus code
was correct.

The actual Splus code that ultimately worked for me was that suggested
by Tony Plate.
In my case, the code was ...

> trellis.device(postscript, file="tumcat.ps", horizontal=T, colors=ps.rgb2hsb(mycolors), onefile=T, background=-1)

> plot(sdate, y4, xlim=c(xmin, xmax), ylim=c(0, 1), xlab="Surgery Date", ylab="Pred Probs", main="T1 STATUS\n(All Centres)", type="n", axes=F)
> points(sdate, y1, col=10)
> points(sdate, y4, col=12)
> axis(1, at=date.integer, labels=year.char)
> axis(2)
> legend(10500, .9, c("T1a,b", "T1c"), fill=c(10,12))

> dev.off()

where, mycolors is a matrix that I extracted from the ps.colors.rgb as

> mycolors.list <- c("black","ivory", "lavender", "navy blue", "slate blue", "royal blue", "blue", "sky blue", "turquoise", "cyan", "dark olive green", "lawn green", "forest green", "indian red", "salmon", "orange", "tomato", "red", "deep pink", "maroon", "violet", "purple", "yellow")
> mycolors <- ps.colors.rgb[mycolors.list,]
> 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

Therefore, references to 'col=10' and 'col=12' in the points statements
are respectively to 'cyan' and 'lawn green' in mycolors. As is the
reference to 'fill=c(10, 12)' in the lengend statetment.

Note that the colors=ps.rgb2hsb(mycolors) option in the trellis.device
statement simply converts RGB colours to HSB colours.

Notice that I do not refer to screen colours, since WHAT IS DISPLAYED ON
Separating these two processes considerably simplifies the task,
although as Mona Kanaan pointed out, there is a way to produce colour
postscript files straight from the colour plots displayed on the screen
in the motif/X11 window.

However, since I wanted to batch process my plots, I chose to take the
route outlined above.

Again, many thanks to all who took the time to share their knowledge.


(I am using Splus Version 3.4 Release 1 for Sun SPARC, SunOS 5.3 : 1996)

,,, (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