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

Home » Public Forums » archive » function graphic property.
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
function graphic property. [message #91599] Tue, 04 August 2015 20:56 Go to next message
Dae-Kyu Shin is currently offline  Dae-Kyu Shin
Messages: 25
Registered: February 2015
Junior Member
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.
Re: function graphic property. [message #91627 is a reply to message #91599] Thu, 06 August 2015 18:05 Go to previous message
jimuba is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: What's New in IDL 8.4
Next Topic: OT: IDL math problem solving

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

Current Time: Wed Oct 08 09:16:39 PDT 2025

Total time taken to generate the page: 0.00447 seconds