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

Home » Public Forums » archive » Legend for plot
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
Legend for plot [message #68003] Thu, 10 September 2009 23:52 Go to next message
b.a is currently offline  b.a
Messages: 26
Registered: July 2009
Junior Member
Hi,

Does anyone know how to place a legend (annotation) inside a draw
widget? The legend that I use is somehow like this:

mywindow = OBJ_NEW ( ' IDLgrWindow ' )
myview = OBJ_NEW ( ' IDLgrView ' )

itemNameArr = ['One', 'two']

myLegend = OBJ_NEW ( ' IDLgrLegend ' , itemNameArr, /
SHOW_OUTLINE)

myview->Add, myLegend
mywindow->Draw, myview

and I have a Widget_draw that contains my plots (curves):

dr_window = WIDGET_DRAW ( tlb , UVALUE= 'draw' )

I know that by " mywindow->Draw, myview " the legend appears in
separate window (like an image) but I couldn't find any way to place
it inside my plot window (the widget_draw).

Thank you
Re: Legend for plot [message #68105 is a reply to message #68003] Thu, 17 September 2009 15:51 Go to previous message
b.a is currently offline  b.a
Messages: 26
Registered: July 2009
Junior Member
Thanks a lot for your information. I will try to get it to work using
iplot(similar to your code).
Re: Legend for plot [message #68113 is a reply to message #68003] Wed, 16 September 2009 20:01 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Sep 16, 11:57 pm, pp <pp.pente...@gmail.com> wrote:
> Ok, now your initial question is more clear: how to put a legend into
> your plot in the draw widget. You can go about it with object graphics
> or direct graphics. I do not remember if there is a built in way to do
> it in direct graphics (have not used them in years), but I know there
> is a routine for that in IDLAstro (http://idlastro.gsfc.nasa.gov/),
> though doing that way still required you to keep track of which lines/
> symbols/colors were used on each plot, to use the same in the legend.
>

The IDLAstro routine is called legend, by the way.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: rotated empirical orthogonal functions
Next Topic: IDL on Mac

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

Current Time: Wed Oct 08 15:34:08 PDT 2025

Total time taken to generate the page: 0.00447 seconds