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

Home » Public Forums » archive » Re: Issues with cgColorbar labels
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Issues with cgColorbar labels [message #77792] Fri, 23 September 2011 03:26 Go to previous message
John Ilee 2 is currently offline  John Ilee 2
Messages: 2
Registered: September 2011
Junior Member
On Sep 22, 5:17 pm, David Fanning <sageande...@gmail.com> wrote:
> On Sep 22, 8:02 am, John Ilee 2 <johnism...@googlemail.com> wrote:
>
>
>
>
>
>
>
>
>
>> I have been trying to find a simple way of producing a filled contour
>> plot with a colour bar in IDL for some time.  However, I always seem
>> to run into issues when it comes to the labels on the colour bar.
>
>> I have tried the following example from David Fanning's excellent
>> website...
>
>> data = cgDemoData(2)
>> LoadCT, 0
>> LoadCT, 33, NColors=10, Bottom=1
>> c_colors = Indgen(10)+1
>> position = [0.1, 0.1, 0.9, 0.75]
>> cgContour, data, NLevels=10, /Fill, Position=position,
>> C_Colors=c_colors
>> cgColorbar, Divisions=10, Range=[Min(data), Max(data)], XMinor=1, $
>>           XTickLen=1.0, Position=[0.1, 0.90, 0.9, 0.94], NColors=10,
>> BOTTOM=1
>
>> ...which works perfectly.
>
>> However, when I try to use the above commands with my own dataset (eg
>> 'data = myarray', which is a 1024x512 array, min value 0.51, max value
>> 1.27), the colour bar labels just display "1" at every tickmark.
>
>> If anyone can point me in the direction of a solution, it would be
>> most appreciated.  I know it must be something simple, but I just
>> can't seem to figure it out.
>
>> (I am running IDL 7.1)
>
>> Many thanks.
>
> Try the FORMAT keyword on the cgColorbar. Something like
> FORMAT='(F0.2)'
> should work.
>
> Cheers,
>
> David

That fixed it.

Thanks for all the suggestions.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: ERROR_MESSAGE
Next Topic: YAIB (yet another IDL blog)

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

Current Time: Wed Oct 08 15:07:35 PDT 2025

Total time taken to generate the page: 0.00401 seconds