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

Home » Public Forums » archive » Adding a plot to an itool Image
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
Adding a plot to an itool Image [message #37956] Thu, 05 February 2004 13:22
mvukovic is currently offline  mvukovic
Messages: 63
Registered: July 1998
Member
A few days ago, I faced a problem of adding a plot to an itool Image.
Not having found anything on the group, after considerable probing, I
managed to do it. Here is the routine, hoping that someone may
improve upon it.

Cheers,

Mirko

PS. I'm getting to really like these iTools.

pro AddPlot2IImage, vX, vY
;; Add a plot to a currently active iTool image.

; This first part was gleaned from iPlot startup.

;; Pack data in IDLVector objects. Offset for pixel size (not sure
if it
;; works.
oDataX = obj_new('idlitDataIDLVector', vX+0.5, NAME = 'X')
oDataY = obj_new('idlitDataIDLVector', vY+0.5, NAME = 'Y')

;; This data is stored in a ParameterSet object
oParmSet = OBJ_NEW('IDLitParameterSet', $
NAME = 'Plot parameters', $
ICON = 'plot', $
DESCRIPTION = 'Plot parameters')
oParmSet -> add, oDataX, PARAMETER_NAME = 'X'
oParmSet -> add, oDataY, PARAMETER_NAME = 'Y'

; I got this from the iTool Developers Guide, p.99

;; The ParameterSet object is passed to the VisPlot.
oPlot = OBJ_NEW('IDLitVisPlot', /REGISTER_PROPERTIES)
oPlot -> OnDataChangeUpdate, oParmSet, '<Parameter Set>'

;; Finally, add the VisPlot to the iImage object. Also from
;; Developers Guide, p. 99
oSys = _IDLitSys_GetSystem()
oTool = oSys -> _GetCurrentTool()
oTool -> Add, oPlot, /AGGREGATE

return
end
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Object Graphics Roting Sphere
Next Topic: using icontour multiple times

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

Current Time: Wed Oct 08 13:20:53 PDT 2025

Total time taken to generate the page: 0.00541 seconds