;********************************************* ; box_1.ncl ; ; Concepts illustrated: ; - Drawing box plots ; - Explicitly setting the X tickmark labels in a box plot ; ;********************************************* 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 ;********************************************** ; Create some fake data ;********************************************** yval = asciiread("data_MJJA",(/15,5/),"float") x = (/1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12.,13.,14.,15./) ; x = (/1.,2.,3.,4./) ;********************************************** ; FOR COLOR opti = True opti@boxWidth = 1.2 ; Width of box (x units) ; opti@boxColors = (/"blue","red","green","blue","red","green","blue","red","green","blue","red","green","blue","red","green"/) ; Color of box(es) opti@boxColors = (/"blue","blue","blue","red","red","red","green","green","green","violet","violet","violet","yellow","yellow","yellow"/) ; Color of box(es) ; create plot ;********************************************** wks = gsn_open_wks("ps","box") ; create postscript file res = True ; plot mods desired res@tmYLMode = "Manual" res@trYMinF = -1 res@trYMaxF = 4.0 res@tmYLTickStartF = res@trYMinF res@tmYLTickEndF = res@trYMaxF res@tmYLTickSpacingF= 0.4 res@tmYLMinorOn = False ; Desliga o minortick do eixo y esquerdo. res@tmYRBorderOn = True ; Habilita a borda do eixo y direito (YR). res@tmXTBorderOn = True ; Habilita a borda do eixo x superior (XB). res@tmXBLabelFontHeightF = 0.014 ; Tamanho da fonte do eixo x inferior (XB). ; res@tiYAxisString = "Precipita"+cedil+atilde+"o (mm/dia)" ; Título do eixo y. ; res@tmYLValues = fspan(-0.2,1,7) ; res@tmYLLabels = "" + res@tmYLValues res@tmXBLabels = (/"CMORPH","GSMaP","TRMM","CMORPH","GSMaP","TRMM","CMORPH","GSMaP","TRMM","CMORPH","GSMaP","TRMM","CMORPH","GSMaP","TRMM"/) ; labels for each box res@tmXBLabelAngleF = 90 ; tilt the XB labels 45 degrees res@tiMainString = "Spatial Correlation over VCC - daily" res@tiYAxisString = "" res@tiXAxisString = "BIAS CORR RMSE" ;*********************************************** ; the function boxplot will except three different ; resource lists. In this default example, we set ; two of them to False. ;********************************************** plot = boxplot(wks,x,yval,opti,res,False) draw(wks) ; boxplot does not call these frame(wks) ; for you end