Re: How to access properties of multiple plots in a function graphics window? [message #86493 is a reply to message #86490] |
Wed, 13 November 2013 13:20   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> Then, I found I could do this without knowing the name of anything.
>
> win = window()
> p1 = plot(cgdemodata(17), color='red', /current)
> p2 = plot(cgdemodata(17), color='green', /overplot, /current)
> objs = cgGetObjects(win, ISA='IDLGRPLOT')
>
> Oddly, there are four plot objects in the window, not two. Maybe the
> other two are used for backing store? Not sure about that. Maybe Mark
> can help us understand this. But, in any case, there appear to be
> duplicates. Oddly, I can't do this:
>
> objs[0].color = 'blue'
> objs[2].color = 'orange'
>
> But, I can do this:
>
> objs[0] -> SetProperty, Color=cgColor('navy', /Triple, /Row)
> objs[2] -> SetProperty, Color=cgColor('orange', /Triple, /Row)
> win.refresh
>
> For what it is worth. :-)
I think what I should have been looking for are IDLVisPlots:
objs = cgGetObjects(win, ISA='idlitvisplot')
There are only two of those, and these are apparently the two plots you
want to work with:
objs[0] -> SetProperty, Color=cgColor('navy', /Triple, /Row)
objs[1] -> SetProperty, Color=cgColor('orange', /Triple, /Row)
win.refresh
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.")
|
|
|