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

Home » Public Forums » archive » cgcolourbar - examples with text labels aligned inside boxes
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
cgcolourbar - examples with text labels aligned inside boxes [message #85650] Fri, 23 August 2013 10:04 Go to next message
Andy Sayer is currently offline  Andy Sayer
Messages: 127
Registered: February 2009
Senior Member
Hi all,

I am probably missing something obvious so perhaps someone here can tell me the answer...

I've adopted cgcolourbar as a much nicer way to make colour bars than what I was doing before, via contour. (Thanks, David!)

I now want to do something I didn't try before: I want a 'categorical' type of colour bar, with text to describe each value, rather than the 'continuous' data type. One of the images in the code's documentation shows what I am looking for:

http://www.idlcoyote.com/idldoc/cg/cgcolorbar.html

I'm looking at the example of the months-of-the-year colour bar, the third one down. So, I know I need to set the /discrete keyword. But how do I align the labels (e.g. 'Jan', 'Feb',...) in the middle of the boxes, rather than along the divisions between boxes (like shown on the top example of the page). I looked through the keywords but didn't see anything obvious, and can't find the example code to produce that colour bar. Does anyone know?

Thanks,

Andy
Re: cgcolourbar - examples with text labels aligned inside boxes [message #85651 is a reply to message #85650] Fri, 23 August 2013 10:11 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
AMS writes:

> I am probably missing something obvious so perhaps someone here can tell me the answer...
>
> I've adopted cgcolourbar as a much nicer way to make colour bars than what I was doing before, via contour. (Thanks, David!)
>
> I now want to do something I didn't try before: I want a 'categorical' type of colour bar, with text to describe each value, rather than the 'continuous' data type. One of the images in the code's documentation shows what I am looking for:
>
> http://www.idlcoyote.com/idldoc/cg/cgcolorbar.html
>
> I'm looking at the example of the months-of-the-year colour bar, the third one down. So, I know I need to set the /discrete keyword. But how do I align the labels (e.g. 'Jan', 'Feb',...) in the middle of the boxes, rather than along the divisions between boxes (like shown on the top example of the page). I looked through the keywords but didn't see anything obvious, and can't find the example code to produce that colour bar. Does anyone know?

Use cgDCBar.

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: cgcolourbar - examples with text labels aligned inside boxes [message #85652 is a reply to message #85651] Fri, 23 August 2013 11:02 Go to previous messageGo to next message
Andy Sayer is currently offline  Andy Sayer
Messages: 127
Registered: February 2009
Senior Member
Thanks, will change to do that instead. I'd just thought there may be a way to do it with cgcolourbar, as the image was from the help page for that routine?

Andy

On Friday, August 23, 2013 1:11:40 PM UTC-4, David Fanning wrote:
> AMS writes:
>
>
>
>> I am probably missing something obvious so perhaps someone here can tell me the answer...
>
>>
>
>> I've adopted cgcolourbar as a much nicer way to make colour bars than what I was doing before, via contour. (Thanks, David!)
>
>>
>
>> I now want to do something I didn't try before: I want a 'categorical' type of colour bar, with text to describe each value, rather than the 'continuous' data type. One of the images in the code's documentation shows what I am looking for:
>
>>
>
>> http://www.idlcoyote.com/idldoc/cg/cgcolorbar.html
>
>>
>
>> I'm looking at the example of the months-of-the-year colour bar, the third one down. So, I know I need to set the /discrete keyword. But how do I align the labels (e.g. 'Jan', 'Feb',...) in the middle of the boxes, rather than along the divisions between boxes (like shown on the top example of the page). I looked through the keywords but didn't see anything obvious, and can't find the example code to produce that colour bar. Does anyone know?
>
>
>
> Use cgDCBar.
>
>
>
> 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: cgcolourbar - examples with text labels aligned inside boxes [message #85653 is a reply to message #85652] Fri, 23 August 2013 11:59 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
AMS writes:

> Thanks, will change to do that instead. I'd just thought there may be a way to do it with cgcolourbar, as the image was from the help page for that routine?

I made the mistake of putting Coyote in charge of pictures and he has
screwed it up again. That picture was meant for cgDCBar. Had to change
it myself just now. :-(

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: cgcolourbar - examples with text labels aligned inside boxes [message #85654 is a reply to message #85653] Fri, 23 August 2013 12:43 Go to previous message
Andy Sayer is currently offline  Andy Sayer
Messages: 127
Registered: February 2009
Senior Member
Pesky Coyote. ;-) Well, the routine works great! Thanks again, David.

On Friday, August 23, 2013 2:59:10 PM UTC-4, David Fanning wrote:
> AMS writes:
>
>
>
>> Thanks, will change to do that instead. I'd just thought there may be a way to do it with cgcolourbar, as the image was from the help page for that routine?
>
>
>
> I made the mistake of putting Coyote in charge of pictures and he has
>
> screwed it up again. That picture was meant for cgDCBar. Had to change
>
> it myself just now. :-(
>
>
>
> 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: Issue using map_set and !p.multi in combination with polyfill to colour window backgrounds
Next Topic: FONT_SIZE in PLOT()

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

Current Time: Wed Oct 08 15:14:48 PDT 2025

Total time taken to generate the page: 0.00636 seconds