Usage of System Variables [message #18160] |
Thu, 02 December 1999 00:00  |
Liam Gumley
Messages: 473 Registered: November 1994
|
Senior Member |
|
|
A colleague and I were having a discussion recently about system
variables in IDL. My colleague regularly uses system variables such as
!p.region, !p.font, !p.margin for configuring plots. My opinion is that
system variables should be used as little as possible. In fact the only
system variable I ever modify is !p.multi for creating multiple plots.
Otherwise I prefer to use keywords to plot, surface, tv, tvscl, etc.
It seems to me that modifying global system variables is not a good
idea, since they have a global effect. These days you can write
applications which run while leaving the IDL command line active, and
setting/modifying system variables in this case sounds like a recipe for
disaster.
Can anyone think of other cases where setting a system variable is the
only way to achieve the desired effect (e.g. !p.multi)?
Cheers,
Liam.
--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
|
|
|
Re: Usage of System Variables [message #18241 is a reply to message #18160] |
Wed, 08 December 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Ed 'the next guy' Meinel (edward.s.meinel@aero.org) writes:
> Of course, that would be true for _any_ editable system variable, so it
> would seem that this whole thread is moot.
Well, *most* of what we discuss here is probably "moot".
But that's what's fun about a newsgroup. You can shoot
the bull with your friends and have it appear to
your boss that you are hard at work. :-)
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
|
|
|
Re: Usage of System Variables [message #18248 is a reply to message #18160] |
Wed, 08 December 1999 00:00  |
edward.s.meinel
Messages: 12 Registered: May 1999
|
Junior Member |
|
|
davidf@dfanning.com (David Fanning) wrote:
> And I've
> never found !P.MULTI to be disastrous, except when
> people forget to turn it off. Then it's disastrous
> for the *next* guy, but that's not my problem. :-)
Of course, that would be true for _any_ editable system variable, so it
would seem that this whole thread is moot.
Oh! Were you backing up Liam's complaint?
Ed 'the next guy' Meinel
Sent via Deja.com http://www.deja.com/
Before you buy.
|
|
|
Re: Usage of System Variables [message #18257 is a reply to message #18160] |
Tue, 07 December 1999 00:00  |
m218003
Messages: 56 Registered: August 1999
|
Member |
|
|
In article <MPG.12b57c2e7791f45a9899b4@news.frii.com>,
davidf@dfanning.com (David Fanning) writes:
> Martin Schultz (m218003@modell3.dkrz.de) writes:
>
> I like to use !P.MULTI because it takes care of a lot of
> other things for you besides position. For example, it
> also handles character sizing appropriately. And I've
> never found !P.MULTI to be disastrous, except when
> people forget to turn it off. Then it's disastrous
> for the *next* guy, but that's not my problem. :-)
>
> Cheers,
>
> David
OK, ok ... I guess it depends on how you manage your system variables. If
you only use one plot window - no problem (if you clean up at the end as you
suggest implicitely). If you use several windows - only a problem if you
don't store the system variable state with each of your windows. And, hey,
how do you do this? ... here we aim again for draw widgets or objects, don't
we?
... and I disagree that !P.Multi handles character sizes "appropriately".
I have often found it more annoying than helpful that characters are shrunk
by 0.62 if there are at least three windows in a row or column. So many of
my programs contain a statement like
if (!p.multi>!p.multi[2]) ge 3 then charsize = charsize/0.62
Cheers,
Martin
--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 41173-298 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
|
|
|
Re: Usage of System Variables [message #18263 is a reply to message #18160] |
Mon, 06 December 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Martin Schultz (m218003@modell3.dkrz.de) writes:
> well, !p.multi can be disastrous in just the same way! Better to use the
> position keyword -- although !p.multi is much easier to use for quick and
> dirty plots, admittedly.
I like to use !P.MULTI because it takes care of a lot of
other things for you besides position. For example, it
also handles character sizing appropriately. And I've
never found !P.MULTI to be disastrous, except when
people forget to turn it off. Then it's disastrous
for the *next* guy, but that's not my problem. :-)
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
|
|
|
Re: Usage of System Variables [message #18265 is a reply to message #18160] |
Mon, 06 December 1999 00:00  |
m218003
Messages: 56 Registered: August 1999
|
Member |
|
|
In article <3846A7E0.27FAA71@ssec.wisc.edu>,
Liam Gumley <Liam.Gumley@ssec.wisc.edu> writes:
> a recipe for disaster.
>
> Can anyone think of other cases where setting a system variable is the
> only way to achieve the desired effect (e.g. !p.multi)?
>
Hi Liam,
well, !p.multi can be disastrous in just the same way! Better to use the
position keyword -- although !p.multi is much easier to use for quick and
dirty plots, admittedly.
Martin
--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 41173-298 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
|
|
|