Re: [S] colour postscript files

mona kanaan (M.N.Kanaan@open.ac.uk)
Wed, 20 May 1998 17:38:17 +0100 (BST)


Hi there,
The following works perfectly for me, by the way I use a unix
based Splus version. All what you want to do is:
1. Open a graphics window.
2. Go to options, choose colour scheme and there you can either use or
create your own scheme, apply it, save it and close the window.
3. before creating your postscript file, use the command
ps.options(image.color=xgetrgb("images"),color=xgetrgb("color"),...)
4. create your postscript file
The output to the posstscript file should resemble the output that you
would get on the screen using the same colour screen.

Hope that is useful

_/_/ _/_/ _/_/_/_/ _/_/ _/ _/_/_/_/ email:M.N.Kanaan@open.ac.uk
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ Statistics Dept.
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/_/_/ The Open University
_/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/ Milton Keynes
_/ _/ _/ _/_/_/_/ _/ _/_/ _/ _/ U.K. MK7 6AA

On Wed, 20 May 1998 fang@utstat.toronto.edu wrote:

> hi mo, colors in postscript are unrelated to Splus, you need to specify
> colors options in postscript() function.
> define a nx3 color matrix colmat for n colors (each row defines one color),
> and use colors=colmat in postscript(). later when you call col=i in your
> graphic function, color defined by the ith row will be used, rather than
> the ith color in splus.
> you need to look up postscript language reference manual for the details
> of how to set up the color matrix so you can get the colors you want.
> if i remember correctly,
> (0,0,0) is black,
> (0,1,i) gives a range of color, where i is a number between 0 and 1.
> however i've never been able to replicate the colors i see on the screen,
> i think for that you need a graphic artist or something who's an expert
> on color encoding in rgb, hsb, etc.
> let me know if there is any problem.
> fang
>
> >
> > Hello,
> >
> > I need to produce colour postscript files.
> >
> > All that I have been able to produce so far are colour plots on my
> > monitor using the following settings in Splus ...
> >
> > > X11.moe <- c("-display moe:0.0",
> > "-xrm 'splus*defaultFont:0'",
> > "-xrm 'splus*fonts:*helvetica-*-R-*-10-*
> > *helvetica-*-R-*-14-*'",
> > "-xrm 'splus*colors: white black 2 red 2 yellow
> > 2 green 2 blue 2 white'",
> > "-xrm 'splus*nHalftones:8'",
> > "-xrm 'splus*halftonePolygon:No'",
> > "-xrm 'splus*halftoneImage:Yes'",
> > "-xrm 'splus*Font:fixed'")
> >
> > > X11(X11.moe)
> >
> >
> >
> > However, it appears that settings for the monitor are unrelated to
> > settings for the printer.
> >
> > So I tried the following ...
> >
> >
> > #####################################################################################
> >
> > > postscript(file="try.ps", colors=xgetrgb("lines"), image.colors=xgetrgb("images"), background=-1)
> >
> > > par(pty="s")
> >
> > > 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[tumcat.a==1], sqr.p1[tumcat.a==1], col=11)
> >
> > > points(sdate[tumcat.a==4], sqr.p4[tumcat.a==4], col=4)
> >
> > > axis(1, at=date.integer, labels=year.char)
> >
> > > axis(2)
> >
> > > legend(10500, .9, c("T1a,b", "T1c"), fill=c(11,4))
> >
> > > dev.off()
> > #####################################################################################
> >
> > All that this did was to produce greyscale output from the printer by
> > doing the following ...
> >
> > I have looked through the ?postscript and ?ps.options help files but
> > remain unable to put together the necessary code to produce what I
> > want. I have also looked through the s-news archives and been unable to
> > solve my problem. Have I overlooked something in my approach?
> >
> > Any help would be greatly appreciated!
> >
> > Thanks in advance.
> >
> >
> > (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
> >
>
> -----------------------------------------------------------------------
> 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
>
-----------------------------------------------------------------------
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