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

Home » Public Forums » archive » Re: Adding an annotation to an iTool programmatically
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
Re: Adding an annotation to an iTool programmatically [message #44229] Wed, 25 May 2005 14:45 Go to next message
Benjamin Hornberger is currently offline  Benjamin Hornberger
Messages: 258
Registered: March 2004
Senior Member
Randall Skelton wrote:
> You can get at what you want with the following:
>
> iPlot, findgen(10), findgen(10)^2
>
> idTool = itGetCurrent(TOOL=oTool)
>
> idAnnotate = oTool->FindIdentifiers('*/ANNOTATION LAYER')
>
> oAnnotate = oTool->getByIdentifier(idAnnotate)
>
> oAnnotate -> add, obj_new('IDLitVisText', _STRING='I wish there were a
> manual that described this', ALIGNMENT=0.5, VERTICAL_ALIGNMENT=0.5,
> FONT_SIZE=14, LOCATION=[0.5,0.8])
>
> Note that the annotation layer uses normalized coordinates while the
> visualization layer will use data coordinates. This means if you want
> to add titles, legends or other floating objects, use the annotation
> layer but if you want to output things that depend on the data (i.e.
> print formatted text corrisponding to the x,y values for every 10th
> data point) then you may be best to add IDLitVisText objects directly
> to the visualization layer.
>
> The above represents a general way of scripting iTools in that you
> first locate the identifier from the tree with FindIdentifiers and then
> either use a DoAction/DoSetProperty operation or grab the relevent
> object. Beyond using the IDs and then finding the object, below are a
> few other 'useful' commands that may be of use in your journey:
>
> oWin = oTool->GetCurrentWindow()
> oView = oWin->GetCurrentView()
> oVisLay = oView->GetCurrentLayer()
>
> You may want to poke around in:
>
> $IDL_DIR/lib/itools/framework
> $IDL_DIR/lib/itools/component
>
> The above points to where the real documentation is ;)
>
> Cheers,
> Randall
>

Oh dear. I was already afraid that it wouldn't be just simple. But
thanks, I'll play with it.

Benjamin
Re: Adding an annotation to an iTool programmatically [message #44230 is a reply to message #44229] Wed, 25 May 2005 14:40 Go to previous messageGo to next message
Benjamin Hornberger is currently offline  Benjamin Hornberger
Messages: 258
Registered: March 2004
Senior Member
Ben Tupper wrote:
> Benjamin Hornberger wrote:
>
>> Hi all,
>>
>> the question below was posted by Mark Rivers on Nov 5, 2003, with no
>> replies. I also want to add a plot title programmatically, so can
>> anybody help by now? I am also backing the request for a keyword to
>> add a title!
>
>
> Perhaps you want VIEW_TITLE?
>
> iplot, findgen(100), name='Plot A',view_title = 'View A'
>
> Ben

I can't find a keyword VIEW_TITLE for iPlot. There's a TITLE keyword,
but that shows up only in the title bar of the window. There's a NAME
keyword ("name for this visualization"), but I'm not sure what it is
used for.

Thanks anyway :-)

Benjamin
Re: Adding an annotation to an iTool programmatically [message #44231 is a reply to message #44230] Wed, 25 May 2005 14:28 Go to previous messageGo to next message
btt is currently offline  btt
Messages: 345
Registered: December 2000
Senior Member
Benjamin Hornberger wrote:
> Hi all,
>
> the question below was posted by Mark Rivers on Nov 5, 2003, with no
> replies. I also want to add a plot title programmatically, so can
> anybody help by now? I am also backing the request for a keyword to add
> a title!

Perhaps you want VIEW_TITLE?

iplot, findgen(100), name='Plot A',view_title = 'View A'

Ben
Re: Adding an annotation to an iTool programmatically [message #44232 is a reply to message #44231] Wed, 25 May 2005 14:16 Go to previous messageGo to next message
Randall  Skelton is currently offline  Randall Skelton
Messages: 31
Registered: October 2004
Member
You can get at what you want with the following:

iPlot, findgen(10), findgen(10)^2

idTool = itGetCurrent(TOOL=oTool)

idAnnotate = oTool->FindIdentifiers('*/ANNOTATION LAYER')

oAnnotate = oTool->getByIdentifier(idAnnotate)

oAnnotate -> add, obj_new('IDLitVisText', _STRING='I wish there were a
manual that described this', ALIGNMENT=0.5, VERTICAL_ALIGNMENT=0.5,
FONT_SIZE=14, LOCATION=[0.5,0.8])

Note that the annotation layer uses normalized coordinates while the
visualization layer will use data coordinates. This means if you want
to add titles, legends or other floating objects, use the annotation
layer but if you want to output things that depend on the data (i.e.
print formatted text corrisponding to the x,y values for every 10th
data point) then you may be best to add IDLitVisText objects directly
to the visualization layer.

The above represents a general way of scripting iTools in that you
first locate the identifier from the tree with FindIdentifiers and then
either use a DoAction/DoSetProperty operation or grab the relevent
object. Beyond using the IDs and then finding the object, below are a
few other 'useful' commands that may be of use in your journey:

oWin = oTool->GetCurrentWindow()
oView = oWin->GetCurrentView()
oVisLay = oView->GetCurrentLayer()

You may want to poke around in:

$IDL_DIR/lib/itools/framework
$IDL_DIR/lib/itools/component

The above points to where the real documentation is ;)

Cheers,
Randall
Re: Adding an annotation to an iTool programmatically [message #44314 is a reply to message #44229] Mon, 06 June 2005 15:09 Go to previous message
AEO is currently offline  AEO
Messages: 5
Registered: September 2003
Junior Member
The VIEW_TITLE keyword is coming in the next version of IDL, v.6.2, due
out this summer, and it will provide the functionality you are looking
for. In the meantime, in IDL 6.1 this can be accomplished using the
technique illustrated here :

http://www.rsinc.com/codebank/search.asp?FID=308

- AO
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Read other GIS format image
Next Topic: Text size weirdness

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

Current Time: Wed Oct 08 19:43:55 PDT 2025

Total time taken to generate the page: 0.00502 seconds