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

Home » Public Forums » archive » Re: Problem with al_legend in IDL
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: Problem with al_legend in IDL [message #76301] Thu, 26 May 2011 11:09
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Well, you should probably use sym=[16,14], or you can just
> pass these values into al_legend directly:
>
> al_legend, items, psym=[16,14], /left

I guess in your case, with different colors, it would
look like this:


al_legend, items, psym=[16,14], colors=['black','gray'], /left

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: Problem with al_legend in IDL [message #76302 is a reply to message #76301] Thu, 26 May 2011 11:00 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Sasha Singh writes:

>
> Hi,
> I am plotting two datasets using symcat symbols and using al-legend to
> show the legend.
> This is how my little routine looks like:
>
> ploterror, x, y, xerr, yerr, /xlog, /ylog, psym=symcat(16,
> COLOR=cgColor('black')), xtitle='days', ytitle=textoidl('Peak flux
> (\mu Jy)')
> oplot, x1, y1, psym=symcat(14, COLOR=cgColor('grey'))
> items = ['Best fit', 'No fit']
> sym=[symcat(16, COLOR=cgColor('black')),symcat(14,
> COLOR=cgColor('grey'))]
> al_legend, items, psym=sym, /left
>
> The problem here is that my final plot is legends 'Best Fit' and 'No
> Fit' but both with the symbols of grey filled
> diamonds, whereas, I will assume that the 'Best Fit' legend should
> have black filled circle symbol and
> 'No fit' legend have grey diamond. I don't know what am I doing wrong.
> If I use simple psym values such as sym=[2,3], the legend looks fine.

Well, you should probably use sym=[16,14], or you can just
pass these values into al_legend directly:

al_legend, items, psym=[16,14], /left

Here is an article on this 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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Problem with al_legend in IDL
Next Topic: You may be able to help me.

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

Current Time: Wed Oct 08 17:19:05 PDT 2025

Total time taken to generate the page: 0.00403 seconds