Re: Contour map

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Jun 01 2010 - 08:59:47 MDT

NCL will try to pick "nice" contour levels for you, depending on the min/max of your data.

To change this, you need to set these resources:

 res@cnLevelSelectionMode = "ManualLevels" ; manual levels
 res@cnMinLevelValF = 218
 res@cnMaxLevelValF = 226
 res@cnLevelSpacingF = 1 ; or whatever you like

There are lots of examples for controlling the contours.

Start with:

http://www.ncl.ucar.edu/Applications/contourLev.shtml
http://www.ncl.ucar.edu/Applications/coneff.shtml

--Mary

On May 31, 2010, at 4:17 PM, Cecille M. Villanueva Birriel wrote:

> Hello,
>
> I am doing a contour map center at US with surface temperature. The color scale is set from 212 to 230. How can I change the interval to 218 to 226?
>
> Thanks
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> ;************************************************
> begin
> ;************************************************
> ; read in netCDF file
> ;************************************************
> a = addfile("jjafields_past.nc","r")
> ;************************************************
> ; read in zonal winds
> ;************************************************
> t = a->t_jja(0,:,:) ; read July zonal winds
> ;************************************************
> ; create plot
> ;************************************************
> wks = gsn_open_wks("ncgm","proj") ; open a ps file
> gsn_define_colormap(wks,"gui_default")
>
>
> res = True
> res@mpProjection = "CylindricalEquidistant" ; choose projection
> res@mpGridAndLimbOn = True ; turn on lat/lon lines
> res@mpPerimOn = False ; turn off box around plot
> res@mpGridLatSpacingF = 30. ; spacing for lat lines
> res@mpGridLonSpacingF = 30. ; spacing for lon lines
> res@mpFillOn = False
>
> res@mpLimitMode = "LatLon"
> res@mpMinLonF = 233.0
> res@mpMaxLonF = 295.0
> res@mpMinLatF = 23.0
> res@mpMaxLatF = 50.0
> res@cnFillOn = True ; color plot desired
> res@cnLineLabelsOn = False ; turn off contour lines
> res@txFontHeightF = 0.015
>
> res@vpXF = 0.1 ; make plot bigger
> res@vpYF = 0.9
> res@vpWidthF = 0.8
> res@vpHeightF = 0.8
>
> res@gsnSpreadColors = True ; use full range of color map
> res@gsnSpreadColorStart = 0
> res@gsnSpreadColorEnd = -1
>
>
> --
> Cecille M. VIllanueva-Birriel
> Graduate Student
> Earth & Atmospheric Sciences
> Purdue University
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jun 1 08:59:53 2010

This archive was generated by hypermail 2.1.8 : Tue Jun 01 2010 - 09:12:20 MDT