[ncl-talk] Contour Plot issue

Mary Haley haley at ucar.edu
Thu Oct 9 16:34:35 MDT 2014


Jonathan,

By default, contour levels in NCL always represent the values *between*
colors, which means you will have one fewer levels than color boxes.

You simply need to provide one less contour level:

    res at cnLevels =  (/1,2,3,4,5,6,7,8,9,10,11,12,
13,14,15,16,17,18,19,20,21,22,23,24/)

Which, by the way, can be done with:

    res at cnLevels =  ispan(1,24,1)

There are other ways to label this labelbar, depending on what your contour
levels actually represent.  See example 14 at:

http://www.ncl.ucar.edu/Applications/labelbar.shtml#ex14

--Mary


On Wed, Oct 8, 2014 at 8:42 AM, jbuzan <jbuzan at purdue.edu> wrote:

> Hello NCL-Talk,
>
> I have a contour issue.
> I am using explicit color bars from a created color map:  25 levels, and
> 25 colors
>     res at cnLevels =
> (/1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25/)
>  ;
>     res at gsnSpreadColorStart  = 3        ;
>     res at gsnSpreadColorEnd  = 27 ;
>
> However, when it makes the color map, NCL 6.1.0 places one extra color
> into the map.  Additionally, the dark red color is the #5, and should be
> the light tan color.
>
> I am not sure how to fix this.
>
> -Jonathan
>
>
>
>
> Colormap colors:
> ;r   g   b
> 255 255 255  ; white background
> 0 0 0    ; black foreground
>
> 0       0       0
>
> 153      84      15
> 178     111      44
> 204     142      81
> 229     177     126
> 255     216     178
> 153      15      15
> 178      44      44
> 204      81      81
> 229     126     126
> 255     178     178
> 107     153      15
> 133     178      44
> 163     204      81
> 195     229     126
> 229     255     178
>  15     107     153
>  44     133     178
>  81     163     204
> 126     195     229
> 178     229     255
>  38      15     153
>  66      44     178
> 101      81     204
> 143     126     229
> 191     178     255
>
> 0       0       0
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141009/02d3c769/attachment.html 


More information about the ncl-talk mailing list