 NCL Home > Documentation > Functions > Date routines

# box_percentile_plot

Creates a box percentile plot. Documentation under construction Available in version 6.4.0 and later.

## Prototype

```load "\$NCARG_ROOT/lib/ncarg/nclscripts/contrib/box_percentile_plot.ncl"

procedure box_percentile_plot (
wks      : graphic,
data        : numeric,
res         : logical,
box_res     : logical,
line_res    : logical,
marker_res  : logical,
per_res     : logical
)
```

## Arguments

wks

A Workstation identifier. The identifier is one returned either from calling gsn_open_wks or calling create to create a Workstation object.

data

res

box_res

line_res

marker_res

per_res

## Description

This function creates a box-percentile plot after calculating the necessary parameters. A plot object is returned, which you can draw with the draw procedure.

This code was contributed by Frank Kreienkamp, DWD, and is based on Esty WW, Banfield J: The box-percentile plot. J Statistical Software 8 No. 17, 2003. (http://www.jstatsoft.org/v08/i17).

## Examples

Below is a complete program you can run to generate a box-percentile plot.

``` load "\$NCARG_ROOT/lib/ncarg/nclscripts/contrib/box_percentile_plot.ncl"

begin ; program

; create plot
wtype                          = "png"
wtype@wkWidth                  =  1000              ; Set the pixel size of image.
wtype@wkHeight                 =  1000
wks                            = gsn_open_wks(wtype,"Box_Percentile_Plot")

i_res                          = True
i_res@tmXBLabels               = (/"a","b"/)
i_res@trYMinF                  = -90
i_res@trYMaxF                  = 90
i_res@tiMainString             = "Box-Percentile-Plot example"

i_boxOpts                      = True
i_boxOpts@boxColors            = "blue" ;(/"blue","blue"/)
i_boxOpts@boxWidth             = 0.4

i_lineRes                      = True
i_lineRes@gsLineThicknessF     = 0.9
i_lineRes@txFontHeightF            = 5
i_lineRes@tmXBLabelFontHeightF     = 9

i_markerRes                    = True
i_markerRes@gsMarkerIndex      = 1
i_markerRes@gsMarkerSizeF      = 0.05
i_markerRes@gsMarkerThicknessF = 1
i_markerRes@gsMarkerColor      = (/"red","blue"/) ;"blue"

i_PerRes                       = True
i_PerRes@gsLineColor           = (/"blue","red"/) ;"blue"
i_PerRes@gsLineThicknessF      = 2
i_PerRes@boxColors             = "blue" ; (/"blue","red"/)
i_PerRes@gsFillColor           = "blue" ; (/"blue","red"/)
i_PerRes@FillBox               = (/True,False/)
i_PerRes@MarkPer               = True ;(/True,True/)
i_PerRes@Avg                   = True ;(/True,True/)

; Create 2 x 13 float array
data = (/(/  2.70,  -21.20,    5.60,  -14.20,   21.10,   19.80,  -15.90, \
-18.40,   -2.50,   63.90,   -2.90,   21.30,  -18.60/), \
(/  7.30,   -3.30,    3.50,    2.00,    6.30,   11.90,   -0.40, \
-6.50,    3.80,   34.70,    0.40,   14.20,   -4.00/)/)

box = box_percentile_plot( wks,data, i_res,i_boxOpts,i_lineRes,i_markerRes,i_PerRes)

; Drawing plot
draw(box)
frame(wks)
end ; program
```