;---Read data and calculate PDF a = addfile("test_file.nc","r") data = a->data printMinMax(data,0) ;---Calculate two sets of PDFs: 10 bins and 25 bins dpdf0 = pdfx(data(:,0), 0, False) dpdf1 = pdfx(data(:,1), 0, False) ;---Start the graphics section wks = gsn_open_wks ("png","bintest2") res = True res@gsnMaximize = True ; maximize plot in frame res@gsnDraw = False ; will panel both res@gsnFrame = False ; plots later. res@vpWidthF = 0.8 ; make plot wider than it res@vpHeightF = 0.4 ; is high res@gsnXYBarChart = True ; Draw the bins as bars res@gsnYRefLine = 0. ; instead of an XY curve res@gsnXYBarChartColors = "tan" res@tmXBMode = "Explicit" ; Label the X axis with the res@tmXBLabelFontHeightF = 0.008 ;---Plot the first dimension res@tiMainString = "data(:,0)" res@tmXBValues = dpdf0@bin_bounds ; bin values res@tmXBLabels = sprintf("%4.2f",dpdf0@bin_bounds) plot0 = gsn_csm_xy (wks, dpdf0@bin_center, dpdf0, res) ;---Plot the second dimension res@tiMainString = "data(:,1)" res@tmXBValues = dpdf1@bin_bounds ; bin values res@tmXBLabels = sprintf("%4.2f",dpdf1@bin_bounds) plot1 = gsn_csm_xy (wks, dpdf1@bin_center, dpdf1, res) pres = True pres@gsnMaximize = True ; maximize plot in frame gsn_panel(wks,(/plot0,plot1/),(/2,1/),pres)