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

Home » Public Forums » archive » adding legend to overlapping cghistoplot histograms
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
adding legend to overlapping cghistoplot histograms [message #88057] Mon, 17 March 2014 06:15 Go to next message
Jahvasc is currently offline  Jahvasc
Messages: 9
Registered: March 2014
Junior Member
Hi,

I tried to add a legend to a plot made with two overlapping histograms but I couldn't. I'm using basically what is described in David Fanning's page http://www.idlcoyote.com/graphics_tips/overlaphisto.html. Can anyone help me with this?
Thanks in advance,
Jaqueline
Re: adding legend to overlapping cghistoplot histograms [message #88058 is a reply to message #88057] Mon, 17 March 2014 06:21 Go to previous messageGo to next message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
Can you give us an idea of what you are doing and what is going wrong? Perhaps include the program you wrote...
Re: adding legend to overlapping cghistoplot histograms [message #88059 is a reply to message #88058] Mon, 17 March 2014 08:10 Go to previous messageGo to next message
Jahvasc is currently offline  Jahvasc
Messages: 9
Registered: March 2014
Junior Member
Em segunda-feira, 17 de março de 2014 14h21min18s UTC+1, Matthew Argall escreveu:
> Can you give us an idea of what you are doing and what is going wrong? Perhaps include the program you wrote...

Ok, here is the program:

items=['Disk stars','Diskless stars']

if(kd ne !NULL) then $
cgHistoplot,P[kd],binsize=0.5,xrange=[0.,16.],$
max_value=maxvalue,$
/fill,polycolor=['light coral']

cgHistoplot,P[kdl],binsize=0.5,/oplot,$
xrange=[0.,16.],/fill,polycolor=['royal blue']

firstPlot=cgsnapshot()

cgHistoplot,P[kdl],binsize=0.5,xrange=[0.,16.],/fill,$
max_value=maxvalue,polycolor=['royal blue']

if(kd ne !NULL) then $
cgHistoplot,P[kd],binsize=0.5,/fill,$
/oplot,xrange=[0.,16.],polycolor=['light coral']

secondPlot=cgsnapshot()

cgBlendimage, firstPlot, secondPlot, ALPHA=0.75

AL_legend,items, PSym=16,charsize=1.,/window,$
SymSize=1, Color=['light coral','royal blue'],pos=[7.,15000]

Then I got the message "A cgwindow does not exist to add a command to". But I cannot figure out which options I should use in order to have the blending and the legend.

Thank you for your attention,
Jaqueline
Re: adding legend to overlapping cghistoplot histograms [message #88060 is a reply to message #88059] Mon, 17 March 2014 08:30 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Jahvasc writes:

> Then I got the message "A cgwindow does not exist to add a command to". But I cannot figure out which options I should use in order to have the blending and the legend.

Remove the WINDOW keyword on you AL_Legend command.

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: adding legend to overlapping cghistoplot histograms [message #88061 is a reply to message #88060] Mon, 17 March 2014 08:38 Go to previous message
Jahvasc is currently offline  Jahvasc
Messages: 9
Registered: March 2014
Junior Member
I did that, but then I got only the last item...
But the problem was that I was ill-defining the "items" parameter..
Sorry to take your time with such a silly question.
Thank you all,
Jaqueline

Em segunda-feira, 17 de março de 2014 16h30min59s UTC+1, David Fanning escreveu:
> Jahvasc writes:
>
>
>
>> Then I got the message "A cgwindow does not exist to add a command to". But I cannot figure out which options I should use in order to have the blending and the legend.
>
>
>
> Remove the WINDOW keyword on you AL_Legend command.
>
>
>
> Cheers,
>
>
>
> David
>
>
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Pi is Rotten?
Next Topic: IDL's function SFIT coefficients

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

Current Time: Wed Oct 08 15:06:26 PDT 2025

Total time taken to generate the page: 0.00618 seconds