Re: gsn_csm_contour_map

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Mon, 25 Feb 2008 10:03:10 -0700

Hi Halil,

Whenever you want to specify the contour levels, you need to set
the cnLevelSelectionMode resource:
http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnLevelSelectionMode

You can see this resource used here:
http://www.ncl.ucar.edu/Applications/color.shtml#ex2

In your case, you will want to do something like this:

   res_at_cnLevelSelectionMode = "ManualLevels"
   res_at_cnMinLevelValF = 1
   res_at_cnMaxLevelValF = 10
   res_at_cnLevelSpacingF = 1

as you have data that starts at 0 and goes up to 10. (Note that that
those settings will create a labelbar with 11 colors. The first color
will be for all areas whose values is less than 1.) If you want, you
could set the following resources as well to put labels in the middle of
your label bar, denoting that the first color corresponds to those areas
equal to 0, the second to areas = 1, and so on:

   res_at_lbLabelStrings = ispan(0,10,1) ; 0, 1, 2, 3, 4,etc
   res_at_lbLabelPosition = "Center" ; label position
   res_at_lbLabelAlignment = "BoxCenters"

Adam

Halil Bisgin wrote:
> Hello all,
> I have a data set to be contoured on a map so my friend has suggested me
> to use gsn_csm_contour_map. I have used and got a picture, but I a group
> of data seems to be missing in the plot. To clarify, I have a 120x342
> matrix in which there are only integers from 0 to 10 (I use zero for sea
> areas). When I run my script which is attached to this mail, I got only
> 9 colors in the plot. Colorbar also has the same problem. On the other
> hand, when I have values from 0 to 4 I obtain exact number of colors,
> but color bar shows floating numbers instead of integers. I cannot not
> find where the problem is.
>
> Thank You
> Halil
>
> ps: sorry for a crowded ncl code. It is because I tried to modify it
> from somewhere else and there are some commented lines.
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Feb 25 2008 - 10:03:10 MST

This archive was generated by hypermail 2.2.0 : Fri Feb 29 2008 - 11:15:04 MST