comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » How to get all graphics elements in a Window?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
How to get all graphics elements in a Window? [message #94412] Fri, 12 May 2017 13:45 Go to next message
Ayris Narock is currently offline  Ayris Narock
Messages: 2
Registered: May 2017
Junior Member
Hi,

I feel like this should be a simple question but I simply can not find any documentation. It seems like this functionality should exist . . . I hope someone can help.

After using the Plot() or Window() functions I can get a reference to the window (help lists it as a <GRAPHICSWIN>)

I can access the graphics elements contained within if I already know their names using bracket notation, like so:

--------------
x = Findgen(200)
y = Sin(x*2*!PI/25.0)*Exp(-0.01*x)
y2 = Cos(x*2*!PI/25.0)*Exp(-0.01*x)
p = PLOT(x, y, TITLE='PanHandler Test',name="name1")
p2 = PLOT(x,y2, name="name2",OVERPLOT=p)

w = GetWindows(/CURRENT)
p1 = w['name1']
p2 = w['name2']
p1.Select
p2.Select
---------------

But, if I don't already know 'name1' and 'name2', and just have the reference to the window, w, how can I retrieve a reference to all the graphics contained in w?

Thanks,
Ayris
Re: How to get all graphics elements in a Window? [message #94413 is a reply to message #94412] Sat, 13 May 2017 06:33 Go to previous messageGo to next message
Markus Schmassmann is currently offline  Markus Schmassmann
Messages: 129
Registered: April 2016
Senior Member
Am 12.05.2017 um 22:45 schrieb Ayris Narock:
> I feel like this should be a simple question but I simply can not find any documentation. It seems like this functionality should exist . . . I hope someone can help.
>
> After using the Plot() or Window() functions I can get a reference to the window (help lists it as a <GRAPHICSWIN>)
>
> I can access the graphics elements contained within if I already know their names using bracket notation, like so:
>
> --------------
> x = Findgen(200)
> y = Sin(x*2*!PI/25.0)*Exp(-0.01*x)
> y2 = Cos(x*2*!PI/25.0)*Exp(-0.01*x)
> p = PLOT(x, y, TITLE='PanHandler Test',name="name1")
> p2 = PLOT(x,y2, name="name2",OVERPLOT=p)
>
> w = GetWindows(/CURRENT)
> p1 = w['name1']
> p2 = w['name2']
> p1.Select
> p2.Select
> ---------------
>
> But, if I don't already know 'name1' and 'name2', and just have the reference to the window, w, how can I retrieve a reference to all the graphics contained in w?

if you know one of the graphic elements names or have it's handle, you
can get all, by

p.Select, /all
pp=w.getSelect()

otherwise use

pp=w.HitTest(w.dimensions[0]/2,w.dimensions[1]/2, $
dimensions=w.dimensions)

but this will give you more, incl. some axes, you will then have to
filter out what you want.


Markus
Re: How to get all graphics elements in a Window? [message #94414 is a reply to message #94413] Sat, 13 May 2017 07:36 Go to previous message
Ayris Narock is currently offline  Ayris Narock
Messages: 2
Registered: May 2017
Junior Member
That makes perfect sense, Thank you!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Isotropic keyword in plot (function graphics)
Next Topic: Convolving in-situ remote sensing reflectance with Landsat's spectral band responses

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 08:58:50 PDT 2025

Total time taken to generate the page: 0.00435 seconds