|
Re: xyouts for iPlot? [message #55594 is a reply to message #55592] |
Fri, 31 August 2007 20:17  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
pdoherty writes:
>
> Thank you to all who responded to my post and provided so much
> interesting and useful information. I really appreciate it.
>
> I've got the functionality I was looking for and my users will
> be happy. I've also got the feeling I'm going to be looking into
> all this object graphics and iTool stuff a lot more closely.
I've followed this up with an article and a program you can
download:
http://www.dfanning.com/ixyouts.html
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
Re: xyouts for iPlot? [message #55605 is a reply to message #55603] |
Thu, 30 August 2007 16:48  |
pdoherty
Messages: 8 Registered: April 2007
|
Junior Member |
|
|
Thank you to all who responded to my post and provided so much
interesting and useful information. I really appreciate it.
I've got the functionality I was looking for and my users will
be happy. I've also got the feeling I'm going to be looking into
all this object graphics and iTool stuff a lot more closely.
Where *is* that copy of 'Power Graphics with IDL' anyway?...
- Peter
|
|
|
Re: xyouts for iPlot? [message #55614 is a reply to message #55605] |
Thu, 30 August 2007 07:00  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Kenneth Bowman wrote:
> In article <fb46j0$l8r$1@news.nems.noaa.gov>,
> Paul van Delst <Paul.vanDelst@noaa.gov> wrote:
>
>> Holy cow.
>
> Hey, I didn't *write* the iTools. Someone gave me this snippet
> (Mike Galloy?) and I'm just passing it along. :-)
Oh, I know. I wasn't expressing my incredulity at you for suggesting it, but that it is
even necessary.
I have always thought (even when DG was the only game in town) that IDL should provide
some value-added tools that were simply layers over the standard commands. E.g. back in
'96, I wrote my own plotting tool that allows me to interactively zoom. That project was
(still is) a complete hack but I use that tool nearly every single day. Easy to use and
waaaay faster than iplot. And people's eyebrows still arch when they see it in use
(although that probably says more about the lack of other-than-Fortran language fluency
where I work!).
I write enough code in Fortran95 that simply moves data around, reformats it, etc. I don't
want to have to do the same sort of thing in IDL just so I can look at said data.
It seems to me that need for these "extra layer" tools has increased with the advent of
iTools. An easy solution (from my perspective) is for ITTVIS to send a big, fat cheque to
David Fanning so that he can address the issue. (If that doesn't get me an honorary invite
to the next IEPA meeting, I don't know what will :o)
> My iTools programs are *filled* with stuff like this. I don't
> do it because I like it, I do it because it is necessary to
> get the kind of interactive 3-D graphics that I need.
I understand.
> If you want to see an example of some of the cool things that
> can be be done with iTools, download this binary file:
>
> http://csrp.tamu.edu/hiaper/archive/502rf01_o3_pv.isv
>
> Start an iTool (e.g., iPlot). Use the File menu to open the
> .isv file. Click on the graphic to select it. You can then
> rotate the graphic smoothly in real time.
I have used iTools and I know they can do amazing things (I've even posted to that effect
here). Maybe I've just become a curmudgeonly old fart, but when I get back from vacation,
I find it much easier to remember,
PLOT, x, y
XYOUTS, 0.5, 0.5, "Hello", /norm
than
iPLOT, x, y
idAnnotate = itool_obj -> FindIdentifiers('*/ANNOTATION LAYER')
oAnnotate = itool_obj -> getByIdentifier(idAnnotate)
oAnnotate -> add, OBJ_NEW('IDLitVisText', _STRING = 'Hello', $
ALIGNMENT = 0.5, $
VERTICAL_ALIGNMENT = 1.0, $
FONT_SIZE = 24, $
LOCATION = [0.5, 0.5, 0.5])
cheers,
paulv
|
|
|
Re: xyouts for iPlot? [message #55622 is a reply to message #55614] |
Wed, 29 August 2007 12:45  |
Kenneth Bowman
Messages: 86 Registered: November 2006
|
Member |
|
|
In article <fb46j0$l8r$1@news.nems.noaa.gov>,
Paul van Delst <Paul.vanDelst@noaa.gov> wrote:
> Holy cow.
Hey, I didn't *write* the iTools. Someone gave me this snippet
(Mike Galloy?) and I'm just passing it along. :-)
My iTools programs are *filled* with stuff like this. I don't
do it because I like it, I do it because it is necessary to
get the kind of interactive 3-D graphics that I need.
If you want to see an example of some of the cool things that
can be be done with iTools, download this binary file:
http://csrp.tamu.edu/hiaper/archive/502rf01_o3_pv.isv
Start an iTool (e.g., iPlot). Use the File menu to open the
.isv file. Click on the graphic to select it. You can then
rotate the graphic smoothly in real time.
Ken Bowman
|
|
|
Re: xyouts for iPlot? [message #55629 is a reply to message #55622] |
Wed, 29 August 2007 10:53  |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On Aug 29, 10:36 am, David Fanning <n...@dfanning.com> wrote:
> Paul van Delst writes:
>> Holy cow.
>
> Yeah, I had exactly the same idea, but I packed a little
> more functionality into it:
>
> PRO iXYOUTS, id, theString
> theSystem = _IDLitSys_GetSystem()
> theTool = theSystem -> GetByIdentifier(id)
> idAnnotate = theTool -> FindIdentifiers('*/ANNOTATION LAYER')
> oAnnotate = theTool -> getByIdentifier(idAnnotate
> oAnnotate -> add, OBJ_NEW('IDLitVisText', _STRING = theString,
> ALIGNMENT = 0.5, $
> VERTICAL_ALIGNMENT = 1.0, $
> FONT_SIZE = 24, $
> LOCATION = [0.5, 0.5, 0.5])
> END
>
> This way it can be used with ANY iTool, as long as you
> remember to get the identifier when you call the tool.
>
> IDL> IPlot, findgen(11), Identifier=id
> IDL> iXYOUTS, id, 'This is any old string.'
>
The ID should probably be an optional keyword. Then ITGETCURRENT()
could be used to get the current iTool (i.e. same basic idea as the
current graphics window) if the ID is not provided.
Mike
--
www.michaelgalloy.com
|
|
|
Re: xyouts for iPlot? [message #55634 is a reply to message #55629] |
Wed, 29 August 2007 09:36  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paul van Delst writes:
> Holy cow.
Yeah, I had exactly the same idea, but I packed a little
more functionality into it:
PRO iXYOUTS, id, theString
theSystem = _IDLitSys_GetSystem()
theTool = theSystem -> GetByIdentifier(id)
idAnnotate = theTool -> FindIdentifiers('*/ANNOTATION LAYER')
oAnnotate = theTool -> getByIdentifier(idAnnotate
oAnnotate -> add, OBJ_NEW('IDLitVisText', _STRING = theString,
ALIGNMENT = 0.5, $
VERTICAL_ALIGNMENT = 1.0, $
FONT_SIZE = 24, $
LOCATION = [0.5, 0.5, 0.5])
END
This way it can be used with ANY iTool, as long as you
remember to get the identifier when you call the tool.
IDL> IPlot, findgen(11), Identifier=id
IDL> iXYOUTS, id, 'This is any old string.'
> At the very, IDL should provide the same basic functionality and *ease of use* for OG as
> we have in DG.
I can see the need for some simplified object graphics
programs meshing nicely with object widgets. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: xyouts for iPlot? [message #55635 is a reply to message #55634] |
Wed, 29 August 2007 09:23  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Kenneth Bowman wrote:
> In article <1188352232.492045.316340@l22g2000prc.googlegroups.com>,
> pdoherty <pedoherty@earthlink.net> wrote:
>
[snip]
>> So, in as few words as possible, can someone tell me how to annotate a
>> plot I've made by calling iPlot from within my program?
>>
>> Sorry if this is a trivial problem, but I haven't figured it out.
>>
>
> You need to do something like this
>
> idAnnotate = itool_obj -> FindIdentifiers('*/ANNOTATION LAYER') ;Get annotation layer ID
> oAnnotate = itool_obj -> getByIdentifier(idAnnotate) ;Get annotation object
> oAnnotate -> add, OBJ_NEW('IDLitVisText', _STRING = 'This is a string', $ ;Add title in annotation plane
> ALIGNMENT = 0.5, $
> VERTICAL_ALIGNMENT = 1.0, $
> FONT_SIZE = 24, $
> LOCATION = [0.5, 0.5, 0.5])
>
Holy cow.
Would syntactic sugar be sufficient to avoid the first two calls? Why can't the interface
to add a text string do all the heavy lifting so the user doesn't have to necessarily know
about retrieving identifiers and objects and knowing the precise object name(s)?
('IDLitVisText'? Who came up with that oh so intuitive name?)
e.g.
PRO itool_xyouts, itool_obj, string, _extra=extra
idAnnotate = itool_obj -> FindIdentifiers('*/ANNOTATION LAYER')
oAnnotate = itool_obj -> getByIdentifier(idAnnotate)
oAnnotate -> add, OBJ_NEW('IDLitVisText', _STRING = string, _extra=extra)
END
At the very, IDL should provide the same basic functionality and *ease of use* for OG as
we have in DG.
cheers,
paulv
|
|
|
Re: xyouts for iPlot? [message #55636 is a reply to message #55635] |
Wed, 29 August 2007 08:02  |
Kenneth Bowman
Messages: 86 Registered: November 2006
|
Member |
|
|
In article <1188352232.492045.316340@l22g2000prc.googlegroups.com>,
pdoherty <pedoherty@earthlink.net> wrote:
> One of these days I'll learn all about the iTools. So far, they don't
> seem
> all that useful. Awkward user interface, mostly. For now, I have one
> use
> for them.
>
> I'd like to make it possible for my users to use the iPlot tool for
> annotating
> and printing plots of the data we collect. I've figured out how to
> call iPlot
> when required and how to use overplot to add additional data to the
> plots.
> What I don't know how to do is to add text to the plots (not using the
> awkward user interface, but from my program) so that the plots I
> present
> my users within iPlot have the same information on them as the direct
> graphics plots they see normally. A plot title that wasn't the title
> of the
> window the plot is in, for instance. Some interesting results that
> were
> computed as text below the plot, that sort of thing.
>
> So, in as few words as possible, can someone tell me how to annotate a
> plot I've made by calling iPlot from within my program?
>
> Sorry if this is a trivial problem, but I haven't figured it out.
>
> - Peter
You need to do something like this
idAnnotate = itool_obj -> FindIdentifiers('*/ANNOTATION LAYER') ;Get annotation layer ID
oAnnotate = itool_obj -> getByIdentifier(idAnnotate) ;Get annotation object
oAnnotate -> add, OBJ_NEW('IDLitVisText', _STRING = 'This is a string', $ ;Add title in annotation plane
ALIGNMENT = 0.5, $
VERTICAL_ALIGNMENT = 1.0, $
FONT_SIZE = 24, $
LOCATION = [0.5, 0.5, 0.5])
Also, search the IDL docs for the string "onglass" for more on 3-D and
"on-the-glass text
Ken Bowman
|
|
|