[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Change default value of system variable?
- Subject: Re: Change default value of system variable?
- From: davidf(at)dfanning.com (David Fanning)
- Date: Fri, 23 Feb 2001 10:11:18 -0700
- Newsgroups: comp.lang.idl-pvwave
- Organization: Fanning Software Consulting
- References: <230220011054580017%k-bowman@null.tamu.edu>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:23637
K. Bowman (k-bowman@null.tamu.edu) writes:
> I prefer to plot with black lines on a white background, so in my
> idl_startup file I include
>
> !P.BACKGROUND = COLOR_24('white') ;Set background color to white
> !P.COLOR = COLOR_24('black') ;Set default draw color to black
>
> (COLOR_24 is my own routine.)
>
> This works fine until I change plot devices and then change back, viz.
>
> flow>idl
> IDL Version 5.3 (IRIX mipseb). (c) 1999, Research Systems, Inc.
> IDL> PRINT, !P.BACKGROUND, !P.COLOR
> 16777215 0
> IDL> SET_PLOT, 'PS'
> IDL> SET_PLOT, 'X'
> IDL> PRINT, !P.BACKGROUND, !P.COLOR
> 0 255
>
> This means that I have to include code to set !P.BACKGROUND and
> !P.COLOR in every time I switch graphics devices. Is there any way to
> change the default value of a built-in system variable?
Uh, use somebody else's routine:
!P.Background = FSC_Color("white", !P.Background)
!P.Color = FSC_Color("black", !P.Color)
That will work correctly *everywhere*. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155