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

Home » Public Forums » archive » multiple legend
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
multiple legend [message #76009] Mon, 16 May 2011 07:51 Go to next message
abc is currently offline  abc
Messages: 46
Registered: March 2011
Member
Dear all,
I am using IDL to make plots. As I am over-plotting
the symbols on the line and I want to make legend for both of them
with the same color as they are appearing in the plot. Here is my
small program but when i run that program it overwrite the previous
legend. i don't know how to show both the legend in a single plot.

cgPlot,A,B,color='red',linestyle=0,background='white', $
xtit='A', ytit='B'
lines=0
items='A'
colors = cgcolor('red')
al_legend,items, linestyle=0,/right, /top,color=colors
cgplot, A,C,psym=2,color='green',SYMSIZE=2,/overplot
psym=2
items='C'
colors = cgcolor('green')
al_legend,items, linestyle=0,psym=7,/right, /top,color=colors

Thanks in advance
Re: multiple legend [message #76127 is a reply to message #76009] Mon, 16 May 2011 19:03 Go to previous message
Brian Wolven is currently offline  Brian Wolven
Messages: 94
Registered: May 2011
Member
On Monday, May 16, 2011 3:50:07 PM UTC-4, David Fanning wrote:

> All for naught. He sees
> right through me. :-(

Congratulations. Apparently you made yourself perfectly clear. ;)
Re: multiple legend [message #76139 is a reply to message #76009] Mon, 16 May 2011 12:50 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
abc writes:

> Respected Sir,
> Thanks a lot for the article. It works now.

Think of all that work I've done cultivating
the Coyote brand. All for naught. He sees
right through me. :-(

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: multiple legend [message #76141 is a reply to message #76009] Mon, 16 May 2011 12:27 Go to previous message
abc is currently offline  abc
Messages: 46
Registered: March 2011
Member
On May 16, 5:13 pm, wlandsman <wlands...@gmail.com> wrote:
> I think you can use a single call to al_legend, e.g.
>
> cgPlot,A,B,color='red',linestyle=0,background='white',  xtit='A', ytit='B'
> cgplot, A,C,psym=2,color='green',SYMSIZE=2,/overplot
> al_legend,['A','C'], linestyle=0,psym=[0,2],/right, /top,color=['red','green']

Dear,
Thanks a lot for your help, it works now
cheers !!!
Re: multiple legend [message #76142 is a reply to message #76009] Mon, 16 May 2011 12:26 Go to previous message
abc is currently offline  abc
Messages: 46
Registered: March 2011
Member
On May 16, 5:59 pm, David Fanning <n...@idlcoyote.com> wrote:
> abc writes:
>>                 I am using IDL to make plots. As I am over-plotting
>> the symbols on the line and I want to make legend for both of them
>> with the same color as they are appearing in the plot. Here is my
>> small program but when i run that program it overwrite the previous
>> legend. i don't know how to show both the legend in a single plot.
>
> Oddly enough, I just posted an article moments ago on
> this very topic!
>
>   http://www.idlcoyote.com/cg_tips/al_legend.php
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Respected Sir,
Thanks a lot for the article. It works now.
Re: multiple legend [message #76145 is a reply to message #76009] Mon, 16 May 2011 12:01 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Jeremy Bailin writes:

> "GSC" -> "CGS" (I'm assuming) in that article. :-)=

Oh, my gosh, it's getting worse! :-(

Thanks!

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: multiple legend [message #76147 is a reply to message #76009] Mon, 16 May 2011 11:45 Go to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
David,

"GSC" -> "CGS" (I'm assuming) in that article. :-)=

-Jeremy.
Re: multiple legend [message #76156 is a reply to message #76009] Mon, 16 May 2011 08:59 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
abc writes:

> I am using IDL to make plots. As I am over-plotting
> the symbols on the line and I want to make legend for both of them
> with the same color as they are appearing in the plot. Here is my
> small program but when i run that program it overwrite the previous
> legend. i don't know how to show both the legend in a single plot.

Oddly enough, I just posted an article moments ago on
this very topic!

http://www.idlcoyote.com/cg_tips/al_legend.php

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: multiple legend [message #76158 is a reply to message #76009] Mon, 16 May 2011 08:13 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
I think you can use a single call to al_legend, e.g.

cgPlot,A,B,color='red',linestyle=0,background='white', xtit='A', ytit='B'
cgplot, A,C,psym=2,color='green',SYMSIZE=2,/overplot
al_legend,['A','C'], linestyle=0,psym=[0,2],/right, /top,color=['red','green']
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: A Sign of the Times
Next Topic: Re: Add and manipulate a visualization to standard Itool

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

Current Time: Wed Oct 08 15:11:24 PDT 2025

Total time taken to generate the page: 0.00550 seconds