cgcolourbar - examples with text labels aligned inside boxes [message #85650] |
Fri, 23 August 2013 10:04  |
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   |
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   |
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 #85654 is a reply to message #85653] |
Fri, 23 August 2013 12:43  |
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.")
|
|
|