Legend for plot [message #68003] |
Thu, 10 September 2009 23:52  |
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 #68113 is a reply to message #68003] |
Wed, 16 September 2009 20:01  |
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.
|
|
|