Re: function graphic property. [message #91627 is a reply to message #91599] |
Thu, 06 August 2015 18:05  |
jimuba
Messages: 9 Registered: February 2009
|
Junior Member |
|
|
On Tuesday, August 4, 2015 at 9:56:19 PM UTC-6, Dae-Kyu Shin wrote:
> Hi, i have a question.
> The question is in the example.
>
>
>
> function test123, data, x, y, $
> overplot=overplot
>
> ;; actually, there is a very complicated precess
> ;; but now simple case
>
>
> ;; Question. When keyword set "overplot=1" How can i get the "i1" property
> ;; (rgb_table, min_value.. and so on)?.
> ;; Yes, i know the esay way that overplot=i1.
> ;; But is this possible get the property of latest graphic(in this example, "i1")?
> ;;
>
>
> i = image(data, x, y, $
> rgb_table=rgb_table, $
> overplot=overplot, $
> /axis, aspect_ratio=0)
> return, i
> end
>
>
>
>
> pro test
>
>
> data = findgen(300, 300)
> x = findgen(300)
> y = x
>
>
> i1 = image(data, x, y, rgb_table=33)
>
> data2 = dist(300)
> i2 = test123(data2, x+400, y, /overplot
>
> end
>
>
>
> Thanks.
One way you might do this might be to give the first image a Name identifier, for example:
i1 = image(data, x, y, rgb_table=33, name='i1')
and then in test123(), you could do something like this:
i.select, /all
w = i.window
objs = w.getselect()
foreach obj, objs do $
if obj.name eq 'i1' then begin
i1 = obj
break
endif
(You could also use the SCOPE_VARFETCH routine, for example:
i1 = scope_varfetch('i1', level=-1)
However as indicated in the documentation, you should use this functionality with caution.)
Hope this helps.
Cheers,
Jim
Harris VIS
|
|
|