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

Home » Public Forums » archive » Re: Legend for plot
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Legend for plot [message #67999 is a reply to message #67981] Fri, 11 September 2009 08:42 Go to previous messageGo to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Sep 11, 3:52 am, "b.a" <u4565...@anu.edu.au> wrote:
> 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).

You need to add graphics_level=2 to the call to widget_draw, to make
it a window for object graphics. Then the draw widget's value will be
the window object where you should draw your view:

myview = OBJ_NEW ( ' IDLgrView ' )
itemNameArr = ['One', 'two']
myLegend = OBJ_NEW ( ' IDLgrLegend ' , itemNameArr, /SHOW_OUTLINE)
myview->Add, myLegend
dr_window = WIDGET_DRAW ( tlb , UVALUE= 'draw' , graphics_level=2)
widget_control,dr_window,get_value=mywindow
mywindow->Draw, myview
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL on the web?
Next Topic: iplot colorbar label

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

Current Time: Sat Oct 11 21:38:30 PDT 2025

Total time taken to generate the page: 0.63492 seconds