[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Change default value of system variable?
"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.
... deleted ...
>
> 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?
You could simply save and restore the entire !P variable, right?
old_p = !p
set_plot, 'ps'
...
set_plot, 'x'
!p = old_p
This probably wouldn't be much better to type on the command line, but
it would be pretty nice for programming, and you have the satisfaction
that you didn't miss any stray graphics keywords by accident.
Craig
--
--------------------------------------------------------------------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
--------------------------------------------------------------------------