;********************************************* ; 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/spatial_corr_SON_dd",(/4,5/),"float") x = (/1., 4., 7., 10./) ;********************************************** ; FOR COLOR opti = True opti@boxWidth = 1.2 ; Width of box (x units) opti@boxColors = (/"blue","red","green","violet"/) ; 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 = -0.5 res@trYMaxF = 1.0 res@tmYLTickStartF = res@trYMinF res@tmYLTickEndF = res@trYMaxF res@tmYLTickSpacingF= 0.1 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","PERSIANN","TRMM"/) ; labels for each box res@tmXBLabelAngleF = 30 ; tilt the XB labels 45 degrees res@tiMainString = "Spatial Correlation over VCC - daily" ;*********************************************** ; 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