[ncl-talk] bin size

mamadoulamine.mbaye at ucad.edu.sn mamadoulamine.mbaye at ucad.edu.sn
Thu May 21 09:41:33 MDT 2015


Dear,

I would like to reduce the size of the bins for a PDF plot, I got these errors:

==========

warning:bin_bound_min is not a valid resource in pdf_climate_xy at this time
warning:bin_bound_max is not a valid resource in pdf_climate_xy at this time
warning:bin_spacing is not a valid resource in pdf_climate_xy at this time

=============

here is the script:

f =asciiread("/home/data_climate_paper.txt",(/2484,4/),"float")
ucH=f(:,0)
ucR=f(:,1)
bcH=f(:,2)
bcR=f(:,3)
ap= pdfx(ucH,20,True)
bp= pdfx(ucR,20,True)
cp= pdfx(bcH,20,True)
dp= pdfx(bcR,20,True)

nVar    = 4
nBin    = ap at nbins
;plot    = new ( nVar, "graphic")
xx      = new ( (/nVar, nBin/), typeof(ap))
  xx(0,:) = ap at bin_center
  xx(1,:) = bp at bin_center
  xx(2,:) = cp at bin_center
  xx(3,:) = dp at bin_center
  yy      = new ( (/nVar, nBin/), typeof(ap))
  yy(0,:) = (/ ap /)
  yy(1,:) = (/ bp /)
  yy(2,:) = (/ cp /)
  yy(3,:) = (/ dp /)
;=========================================================================================
  wks   = gsn_open_wks ("x11", "pdf_climate" )
res                   = True
res at xyLineThicknesses          = (/4.0,4.0,4.0,4.0/)
  res at xyLineColors             = (/"blue","red","green","orange"/)
  res at xyMonoDashPattern        = True              ; all solid
  res at tiYAxisString            = "PDF (%)"
  res at trXMinF               = 0
  res at trXMaxF               = 40
  res at gsnXYBarChart            = True              ; Create bar plot
  res at gsnXYBarChartOutlineOnly = True
  res at bin_bound_min           =0
  res at bin_bound_max           =20
  res at bin_spacing             =5


  res at tiMainString           = "Probabilty Density Functions"
  plot = gsn_csm_xy (wks, xx, yy, res)
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150521/3043bfbf/attachment.html 


More information about the ncl-talk mailing list