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

Home » Public Forums » archive » Re: 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 #47070 is a reply to message #47069] Sat, 21 January 2006 21:21 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
guillaume.drolet.1@ulaval.ca writes:

> I've been trying to find an answer to this question but unsuccessfully:
>
> In my IDL start up script, I switch the default WIN device background
> and color (!d.background & !d.color) to white and black, respectively.
> However, when I write a Post Script file (set_plot, 'PS') and then get
> back to the WIN device, the device background and color are resetted to
> the default values.
>
> Does anyone have any solution or trick for avoiding such a behavior?

Yes, don't use indices 0 and 255 for *anything*, and
always use a white background color for your WIN device.
Then everything will work *perfectly*. :-)

!P.Background = 254
!P.Color = 253
TVLCT, 255, 255, 255, 254 ; White.
TVLCT, 0, 0, 128, 253 ; Navy blue.
Device, Decomposed=0

Then, like this:

Plot, findgen(11)
thisDev = !D.Name
Set_Plot, 'ps'
Device, /Color, Bits=8
Plot, findgen(11)
Device, /Close
Set_Plot, thisDev

PS file looks like the display, and visa versa. :-)

And, possibly, if you *really* want to do this correctly,
use FSC_COLOR to specify your colors. In other words,

PLOT, findgen(11), Color=FSC_Color('Navy'), $
Background=FSC_Color('white')

always works, too. And you don't have to muck around with
!P.Color, etc.

http://www.dfanning.com/programs/fsc_color.pro

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
Previous Topic: 2D density plot *** hist_2d *** LARGE ARRAYS
Next Topic: Extract a sub-structure from a structure

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

Current Time: Fri Oct 10 22:06:31 PDT 2025

Total time taken to generate the page: 1.67923 seconds