multiple legend [message #76009] |
Mon, 16 May 2011 07:51  |
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  |
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  |
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  |
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  |
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  |
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 #76156 is a reply to message #76009] |
Mon, 16 May 2011 08:59  |
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  |
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']
|
|
|