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

Home » Public Forums » archive » WIN device color and backgnd reset after set_plot command
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: WIN device color and backgnd reset after set_plot command [message #47186 is a reply to message #47071] Thu, 26 January 2006 01:56 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
guillaume.drolet.1@ulaval.ca writes:

> I edited my startup script like this (as David's suggest):
>
> !p.background = fsc_color('white')
> !p.color = fsc_color('Navy')

Uh, I don't remember any discussion about a
startup script. I was suggesting you do this
before you draw graphics in whatever device
you find yourself in. And *especially* you need
to do it if you switch from a 24-bit device to
an 8-bit device, and back, since colors are
represented differently in those environments.

I personally don't use these system variables
for ANY colors I care about, mostly for this
non-equivalence between devices. I try to load
my color tables *before* I draw graphics, and I
explicitly stay away from color indices 0 and
255, mostly because these are used by !P.Color
and !P.Background in this perverse way you are
discovering. :-)

> But the same thing keep happening when I switch from WIN to PS and then
> to WIN again: the plot background and color previously set in my
> startup script are resetted to IDL defaults (i.e. black background and
> white color, which I don't like).
>
> Since I usually plot long expressions, I don't to have to specify plot
> color and background every time I plot data after coming back PS device
> to WIN device.
>
> Again, any useful advice is welcome.

Well, this unhappiness is caused by the odd behavior
of the PostScript device. It switches foreground and
background colors, then completely ignores the background
color. ("You can have any background color you like in PostScript
as long as it is white.") Then, when it switches back, it
mindlessly sets !P.Color to what had previously been
!P.Background and sets !P.Background to 0.

Why? I don't know why. The gods decreed it at some
time in the past and that's the way it is. Get used
to it, is my advice. I think it falls under the
category of "direct graphics", which I understand to
read "hopeless". :-)

Knowing this, of course, allows you to work around it.
Most of us build "wrappers" that allow us to switch
from our graphics device back to our display device,
and visa versa. We change the thickness of plots, the
fonts, and all of the myriad other things we have to
tweak to work around this creaky system. Here is another
thing to go in there.

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Extract a sub-structure from a structure
Next Topic: Swap memory utilization by IDL

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

Current Time: Sun Nov 30 15:06:10 PST 2025

Total time taken to generate the page: 0.56142 seconds