Re: Whats wrong in this panel attach plot?

From: louis Vonder <appopson_at_nyahnyahspammersnyahnyah>
Date: Wed, 17 Sep 2008 12:33:47 +0000 (GMT)

Sorry Caspar,
I forgot to add my script in the previous message.
Thanks

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"

begin

xlat = fspan(1, 15.25, 58)
nlat = 58

xtime = fspan(1, 48, 48)
ntime = dimsizes(xtime)

  xlat_at_units   = "degrees_north"
  xlat_at_long_name = "Latitude"
  xtime_at_units   = "LST"
  xtime_at_long_name = "Time"

     M_std = asciiread("Mean_Std_mat_land", (/nlat, 2/), "float")
     mean_std = transpose(M_std)

 
  fili = systemfunc("ls  Ano_mat_land")
  nfil = dimsizes( fili )

    do n = 0, nfil - 1
       name  = stringtocharacter(fili(n))
      ; name1  = name(0:18)
       name2 = chartostring(name)

       dummy_data = - asciiread(fili(n), (/nlat, ntime/), "float")
 
; Set up coordinate arrays so we can overlay on map.
  dummy_data!0   = "latitude"
  dummy_data!1   = "time"
  dummy_data&latitude = xlat
  dummy_data&time = xtime
  dummy_data_at_units = "%"
  dummy_data@_FillValue    = -9999.
  dummy_data_at_missing_value = dummy_data@_FillValue
   dummy_data_at_long_name = "Fractional coverage"

diro = "./"                     ; Output directory
filo =   name+".nc"             ; Output file
system("/bin/rm -f " + diro + filo)    ; remove if exists

 u  = dummy_data         

;=================================================;
; PLOT 1
;=================================================;
  wks  = gsn_open_wks("png", name2)     ; open a ps file

       gsn_define_colormap(wks,"wh-bl-gr-ye-re")

res    = True

      res_at_gsnDraw                  = False            ; don't draw yet
      res_at_gsnFrame                 = False            ; don't advance frame yet
      res_at_cnFillOn            = True          ; turn on color
      res_at_gsnSpreadColors     = True          ; use full range of colormap
      res_at_cnInfoLabelOn       = False
      res_at_cnInfoLabelPerimOn   = True
      res_at_cnLineLabelsOn       = True                 ; turn on line labels
      res_at_cnLevelSelectionMode        = "AutomaticLevels"   ; set manual contour levels
   
   
    res_at_gsnSpreadColors             = True             ; use full color map
    res_at_gsnSpreadColorEnd           = -3               ; don't use added gray
    res_at_lbOrientation               ="horizontal"        ; vertical label bar
        res_at_lbLabelStride               =   2

   res_at_tmXUseBottom  = False      ; Keep top axis independent of bottom.
   res_at_tmXBLabelsOn  = True       ; have tick mark labels
   res_at_tmXTOn        = False       ; have tick marks

   res_at_tmXBMode      = "Explicit" ; label independently
   res_at_tmXBValues    = (/2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46/)
   res_at_tmXBLabels    = (/"01", "03", "05", "07", "09", "11", "13", "15", "17", "19", "21", "23"/)

 res_at_tmXBMinorValues  = (/2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28 , 30, 32, 34, 36, 40, 42, 44, 46, 48/)

  res_at_tiMainString    = "  "   ; add titles
  res_at_tiXAxisString   = " " 
  res_at_tiYAxisString   = "Latitude"

  res_at_gsnLeftString   = "  "               ; add the gsn titles
  res_at_gsnCenterString = " "
  res_at_gsnRightString  = " "

  plot = gsn_csm_contour(wks, u, res)      ; contour the variable

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  PLOT 2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 xyres                 = True         ; xy plot mods desired
 xyres_at_vpWidthF        = .20          ; set width of second plot
 xyres_at_tmXBMinorOn     = False        ; no minor tickmarks
 xyres_at_tmXBLabelStride = 2            ; label stride
 xyres_at_gsnDraw         = False        ; don't draw yet
 xyres_at_gsnFrame        = False        ; don't advance frame yet
 xyres_at_txFontHeightF   = .015         ; change font height
 plot2 = gsn_csm_xy(wks, mean_std, u&latitude, xyres)

 newplot = gsn_attach_plots(plot, (/plot2/), res, xyres)
 draw(plot)
 frame(wks)
  
   end do
 
end

--- En date de : Mer 17.9.08, Caspar Ammann <ammann_at_ucar.edu> a écrit :
De: Caspar Ammann <ammann_at_ucar.edu>
Objet: Re: [ncl-talk] Whats wrong in this panel attach plot?
À: "louis Vonder" <appopson_at_yahoo.fr>
Cc: "ncl forum" <ncl-talk_at_ucar.edu>
Date: Mercredi 17 Septembre 2008, 13h17

Louis, I can't see your script, but you appear to have applied a slight smoother to the selected time slices. If so, then the end points where the smoother window starts to extend outside the data range will be set to missing. You could use data from further north or south to compute the smooth meridional profile, but only plot in the window you selected.Caspar

On Sep 17, 2008, at 3:01 AM, louis Vonder wrote:
Dear NCL users,
Here attached script (Inspired from www.ncl.ucar.edu/Applications/panel.html   Example 10)  that I am using to plot attached panel.
I am also sending data I used and figure produced by this script.

 I don't know why the second figure (the one using gsn_csm_xy) is not covering the all Y-axis?

There is something wrong in my script?

Thanks for your help.

       <Ano_mat_land><Mean_Std_mat_land><Ano_mat_land.png>_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

 Caspar M. AmmannNational Center for Atmospheric ResearchClimate and Global Dynamics Division - Paleoclimatology1850 Table Mesa DriveBoulder, CO 80307-3000email: ammann_at_ucar.edu    tel: 303-497-1705     fax: 303-497-1348

 

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Sep 17 2008 - 06:33:47 MDT

This archive was generated by hypermail 2.2.0 : Wed Sep 17 2008 - 10:32:36 MDT