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

Home » Public Forums » archive » Re: legend() with a mix of plot() and contour()
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: legend() with a mix of plot() and contour() [message #77970] Thu, 13 October 2011 16:21
Brian Daniel is currently offline  Brian Daniel
Messages: 80
Registered: July 2009
Member
On Oct 13, 12:43 pm, Mark Piper <mpi...@ittvis.com> wrote:
> On 10/12/2011 1:27 PM, Brian J. Daniel wrote:
>
>
>
>> ; draw the function
>> c = contour(r,xx,yy,c_linestyle='__',color='red', C_Value=1.0,
>> Name='Circle', /Overplot)
>
>> ; add a legend
>> l = legend(target=[p,c],position=[0.15,0.85],/Norm)
>
> I think this is a bug; I'll log it. To repair this example, add the
> legend element after creating the legend:
>
>     l.add, c
>
> mp

Thanks for the work-around Mark!
Re: legend() with a mix of plot() and contour() [message #77976 is a reply to message #77970] Thu, 13 October 2011 09:43 Go to previous message
Mark Piper is currently offline  Mark Piper
Messages: 198
Registered: December 2009
Senior Member
On 10/12/2011 1:27 PM, Brian J. Daniel wrote:
>
> ; draw the function
> c = contour(r,xx,yy,c_linestyle='__',color='red', C_Value=1.0,
> Name='Circle', /Overplot)
>
> ; add a legend
> l = legend(target=[p,c],position=[0.15,0.85],/Norm)

I think this is a bug; I'll log it. To repair this example, add the
legend element after creating the legend:

l.add, c

mp
Re: legend() with a mix of plot() and contour() [message #77983 is a reply to message #77976] Wed, 12 October 2011 13:39 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Brian J. Daniel writes:

> I've recently started playing with the NG system. Oddly enough, its
> been working well for me, but I've run into an odd behavior of
> legend(). I use plot() for some data, then to draw a geometrical
> function on top of it, I create coordinate arrays and use contour()
> with the c_value keyword set.
>
> The problem is when I attempt to show a legend only the calls to
> plot() are listed. Nowhere in the documentation does ITT discuss this
> limitation. Has anyone used legend for other graphing routines?

It seems to me that having colorbars and legends attached to
"targets" is a good idea in theory (as long as you don't
think about it too long), but is a disaster in practice,
for exactly the reasons you see here. They are not flexible
enough to be used in all the myriad ways people use them.
They would be much more useful if they could be detached
from targets and treated like any other graphical unit to
be added to a window. (And, it would be *extremely*
helpful if they would stay put when the window is resized!)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: basic structure question
Next Topic: Re: normalisation of PCA bands

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

Current Time: Fri Oct 10 10:17:13 PDT 2025

Total time taken to generate the page: 1.87187 seconds