[ncl-talk] problem with 2nd Label bar

Mary Haley haley at ucar.edu
Tue Mar 29 08:40:10 MDT 2016


Geeta,

Rick is out today, so I'll try to help.

I think you are almost there. The problem is that you are setting
lbFillColors to the full colormap, which has more colors than the levels
that you are specifying.  So, only the first nlevels+1 colors in the color
map are getting selected, which are mostly green.

Since your contours are spanning the full "precip4_11lev" colormap, you
want to make sure that lbFillColors also spans the full color map. To do
this, use the span_color_rgba function. Also, gsn_labelbar_ndc, by default,
centers the labels under each box. However, the levels you've chosen are
contour levels that represent the levels *between* each color box. For
this, then, you additionally want to set lbLabelAlignment to
"InteriorEdges".

Here's what your labelbar code will look like with the fixes:

  levels                  = (/5820,5840,5860,5880,5900/)
  nlevels                 = dimsizes(levels)
  labels                  = "" + levels
  lbres                    = True
  lbres at lbAutoManage      = False
  lbres at lbFillColors      = span_color_rgba ("precip_11lev",nlevels+1)
  lbres at lbPerimOn           = False
  lbres at lbMonoFillPattern = True
  lbres at lbLabelAlignment  = "InteriorEdges"
  lbres at vpWidthF          = 0.04 ; Thickness of labelbar

  lbres at lbLabelFontHeightF= 0.01 ; Thickness of labelbar

                     gsn_labelbar_ndc(wks,5,labels,0.7,0.8,lbres)

--Mary


On Mon, Mar 28, 2016 at 11:46 AM, Geeta Geeta <geetag54 at yahoo.com> wrote:

> thanks Rick. I have corrected it but same issue persists.
>
> Geeta.
>
>
> On Monday, 28 March 2016 10:14 PM, Rick Brownrigg <brownrig at ucar.edu>
> wrote:
>
>
> As far as I can tell, it looks like you specify "precip_11lev" for the
> cnres resource, which is used in the call the gsn_csm_contour(), but then
> specify "CBR_wet" as the colormap used in drawing your labelbar. They are
> similar but not exact.
>
> Hope that helps...
> Rick
>
> On Sun, Mar 27, 2016 at 11:10 AM, Geeta Geeta <geetag54 at yahoo.com> wrote:
>
> I have made 2nd label bar using gsn_labelbar_ndc function. In this label
> bar I have specified the fillColor as the color used for shading the
> contours.
>
> The shaded contours on the 1st Column have been used to draw the
> gsn_labelbar_ndc.
>
> but the colors are different.
>
> pls suggest.
>
> Geeta.
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> 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/20160329/e50cc4c3/attachment.html 


More information about the ncl-talk mailing list