Re: plot and contour inconsistency [message #83551] |
Sun, 10 March 2013 14:16  |
Matthew Argall
Messages: 286 Registered: October 2011
|
Senior Member |
|
|
On Sunday, March 10, 2013 4:31:07 PM UTC-4, David Fanning wrote:
> Matthew Argall writes:
>
>
>
>>
>
>>> This is kind of an odd way to write a program. What are you hoping to
>
>>> accomplish by doing this?
>
>>
>
>> There is a program that makes survey plots of satellite data that has a window that allows me to switch between time periods. I wanted to be able to change a few of the default attributes of the plots for when the range of the data changes by a lot. Also, the bad values are not always weeded out, so there is often a few -1e-31 that throw everything off.
>
>>
>
>> In order to set the default attributes, I filled a structure with a small set of keywords accepted by plot then made a setProperties method to change them. Every time the plot is updated, PLOT now gets called something like
>
>>
>
>> PLOT, x, y, _EXTRA=extra
>
>>
>
>> where "extra" is the structure of properties I want to change.
>
>>
>
>> In for this to work, though, I have to default to the IDL defaults. MAX_VALUE and MIN_VALUE do not have defaults, so I chose +/- !values.f_infinity. Later, I can changed them so that the -1e-31's do not show up.
>
>
>
> Ah, then let me suggest a different way of doing this. The
>
> cgGraphicsKeywords object can keep track of of the "graphics keywords"
>
> required by Plot, Contour, etc. But, the nice thing about this object is
>
> that when asked for the keywords, if a keyword hasn't been defined, then
>
> the keyword value for that keyword will be an undefined variable. In
>
> other words, you don't *have* to define a default value for each and
>
> every keyword. This is because all the keywords are stored as pointers,
>
> and a pointer can return an undefined variable.
>
>
>
> I use this to keep track of plot keywords in cgZPlot, for example. It
>
> works really well. This was the first step required to turn the Coyote
>
> Graphics routines into objects. The cgZPlot program was the first proof
>
> of concept program. Since then, I haven't had much time to work on it,
>
> and no one seems to be clamoring for Coyote Graphics objects, so I
>
> haven't worried too much about it. But, you might be able to use to good
>
> effect. :-)
>
>
>
> See the DrawPlot method in cgZPlot__Define to see how I use it.
>
>
>
> Cheers,
>
>
>
> David
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
That sounds amazing, actually, and will put it to good use.
|
|
|