;************************************************* ; text_4.ncl ;************************************************ load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" ;************************************************ begin ;************************************************ ; open file and read in data ;************************************************ in = addfile("h_avg_Y0191_D000.00.nc","r") t = in->T lat=in->lat_t lon=in->lon_t ;************************************************ ; create plot (this part is ce_3.ncl) ;************************************************ wks = gsn_open_wks("ps" ,"text") ; open a ps file gsn_define_colormap(wks,"BlAqGrYeOrRe") ; choose colormap res = True ; plot mods desired res@cnFillOn = True ; turn on color fill res@cnLinesOn = False ; turn off contour lines res@cnLevelSpacingF = 0.5 ; contour spacing res@gsnSpreadColors = True ; full range of color map res@lbLabelStride = 4 ; every 4th label bar label res@gsnAddCyclic = False ; regional data res@mpMinLatF = -60 ; range to zoom in on res@mpMaxLatF = 30. res@mpMinLonF = 30. res@mpMaxLonF = 120. res@gsnFrame = False ; don't advance frame yet plot = gsn_csm_contour_map_ce(wks,t(0,0,{-60:30},{30:120}), res) ;************************************************ ; add text ;************************************************ tres = True ; text mods desired tres@txFontHeightF = 0.015 ; make smaller ; now add some text the refers to actual values. this might be done to ; double check the plot with data values. do i=0,70,4 gsn_text(wks,plot,sprintf("%3.1f", t(0,0,i,{89})),lon({89}),lat(i),tres) end do frame(wks) ;************************************************ end