comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Why postscript colors are same as screen?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Why postscript colors are same as screen? [message #70836] Mon, 10 May 2010 06:30
Mrunmayee is currently offline  Mrunmayee
Messages: 24
Registered: May 2009
Junior Member
Oh! I didn't even bother to wonder about this! I mean, I knew !p.color
was changed, but somehow I extended it to color table. So I tried
reversing the color table 0 which gives desired o/p (at least on
screen).

And programming Gods? Oh, they HAVE tested me on postscript and sent
me to hell multiple times.

On May 10, 6:03 pm, JM <j...@dmu.ac.uk> wrote:
> Isn't it just the !P.Color system variable (used for drawing) that
> gets changed?
>
> IDL> print, !P.Color
> 16777215
> IDL> SET_PLOT, 'PS'
> IDL> print, !P.Color
> 0
>
> The rationale for this being that default background colour for a plot
> window happens to be black, and the usual colour for paper happens to
> be white.
>
> -John Mardaljevic
>
> PS. The programming gods must be smiling on me: my PS output looks
> pretty much like it does in X-windows. Actually better than in X-
> windows since the PDF[1] is of course vector graphics and any bitmaps
> are shown at the correct (i.e. my) resolution rather than the screens.
>
> [1] I convert the PS directly to PDF using lossless compression and
> junk the PS immediately. Ah, the joys of using a PDF-savvy OS, i.e.
> MAC OS X.
Re: Why postscript colors are same as screen? [message #70837 is a reply to message #70836] Mon, 10 May 2010 06:03 Go to previous message
JM[1] is currently offline  JM[1]
Messages: 8
Registered: October 2009
Junior Member
Isn't it just the !P.Color system variable (used for drawing) that
gets changed?

IDL> print, !P.Color
16777215
IDL> SET_PLOT, 'PS'
IDL> print, !P.Color
0

The rationale for this being that default background colour for a plot
window happens to be black, and the usual colour for paper happens to
be white.

-John Mardaljevic

PS. The programming gods must be smiling on me: my PS output looks
pretty much like it does in X-windows. Actually better than in X-
windows since the PDF[1] is of course vector graphics and any bitmaps
are shown at the correct (i.e. my) resolution rather than the screens.

[1] I convert the PS directly to PDF using lossless compression and
junk the PS immediately. Ah, the joys of using a PDF-savvy OS, i.e.
MAC OS X.
Re: Why postscript colors are same as screen? [message #70839 is a reply to message #70837] Mon, 10 May 2010 04:58 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mrunmayee writes:

> I have an array, say data[311,550]. It contains only 0's and 1's and I
> am trying to display it. When I use
> IDL> tvscl, data
> I get output on the screen with 0's painted with black and 1's with
> white. Exactly what I want. When I do
> IDL> set_plot,'ps'
> IDL> tvscl, data
> IDL> device,/close & set_plot,'x'
> I get output - again 0's are painted black and 1's are painted white.
> I thought, the default color table is reversed when we plot in
> postscript. Which is why plot is balck-background-white-foreground on
> screen but reversed in postscript. But that's not what I am getting
> here. Am I missing something here? When it comes to images, I am very
> very unskilled.

The PostScript color table isn't reversed. It only
*acts* as if it were reversed in certain circumstances,
of which this isn't one of them.

Cheers,

David

P.S. In case you were wondering, the PostScript device
is designed as a test. If the novice IDL programmer
can overcome its inconsistencies to produce a plot that
is even just a reasonable facsimile to what they expected
to get, the programming gods will allow you to proceed
to the next level of the game, which is understanding
the colors used in filled contour plots. :-)



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: passing an idl function to a c-code ?
Next Topic: Polygon Smoothing

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:33:41 PDT 2025

Total time taken to generate the page: 0.00537 seconds