GRASS logo


r.series.boxplot - Draws the boxplot of raster values of a series of input rasters.


display, raster, plot, boxplot, statistics


r.series.boxplot --help
r.series.boxplot [-onhg] map=name[,name,...] [output=file name] [plot_dimensions=string] [dpi=integer] [range=float] [text_labels=string] [rotate_labels=float] [boxplot_width=float] [bxcolor=name] [fontsize=integer] [flier_marker=string] [flier_size=string] [flier_color=name] [--overwrite] [--help] [--verbose] [--quiet] [--ui]


Include outliers
Draw boxplot(s) with outliers
Draw the notch
Draw boxplot(s) with notch
Horizontal boxplot(s)
Draw the boxplot horizontal
grid lines
add grid lines
Allow output files to overwrite existing files
Print usage summary
Verbose module output
Quiet module output
Force launching GUI dialog


map=name[,name,...] [required]
input raster
output=file name
Name of output image file
Name for output file
Plot dimensions (width,height)
Dimensions (width,height) of the figure in inches
Set the resolution of plot
Range (value > 0)
This determines how far the plot whiskers extend out from the box. If range is positive, the whiskers extend to the most extreme data point which is no more than range times the interquartile range from the box. A value of zero causes the whiskers to extend to the data extremes.
Default: 1.5
Boxplot text labels
Give labels of the boxplots (comma separated). If you leave this empty, the raster layer names will be used as labels.
Rotate labels (degrees)
Rotate labels (degrees)
Options: -90-90
Set boxplot width
The width of the boxplots (0,1])
Boxplot color
Color of the boxplots. See manual page for color notation options.
Default: black
Font size
Default font size
Flier marker
Set flier marker (see for options)
Flier size
Set flier size
Flier color
Set flier color
Default: black

Table of contents


r.seriesboxplot draws boxplots of series of input raster layers. It can be used to display both temporal patterns and spatial variation.

The whiskers of the boxplots extend to the most extreme data point, which is no more than range ✕ the interquartile range (iqr) from the box. By default, a range of 1.5 is used, but the user can change this. Note that range values need to be larger than 0. By default, outliers are not included in the plot. Set the -o flag to include them in the plot.

There are a few layout options, including the option to rotate the plot and the x-axis labels, print the boxplot(s) with notches, and define the color of the boxplots.

By default, the raster names are used as labels, but the user can explicitly define the labels (example 3 below). The number of labels need to be the same as the number of input raster layers.

By default, the resulting plot is displayed on screen. However, the user can also save the plot to file using the output option. The format is determined by the extension given by the user. So, if output = outputfile.png, the plot will be saved as a PNG file. The user can set the output size (in inches) and resolution (dpi) of the output image.


If you work with a large number of raster layers, of if the raster layers are very large, try to avoid setting the range value very low, as that may result in a massive number of outliers, slowing down the computations and rendering of the plot.


The examples use the North Carolina full dataset, which you can download from here.

Example 1

Three landsat layers are provided as input. In addition, plot dimensions are set to 12 inch wide, 6 inch height.
r.series.boxplot plot_dimensions=12,6 \

Example 2

The example below uses the same layers as input. In addition, it defines the colors for the boxplots, rotates the labels and sets the fontsize to 14.
r.series.boxplot plot_dimensions=12,6 \
map=lsat7_2002_10,lsat7_2002_20,lsat7_2002_30,lsat7_2002_40,lsat7_2002_50 \
bxcolor=green rotate_labels=45 fontsize=14

See here for the different formats in which colors can be specified.

Example 3

Same example as above, but this time, the outliers are plotted as well (in blue). And the labels are explicitly defined.
r.series.boxplot -o plot_dimensions=12,6 rotate_labels=45 fontsize=14 \
map=lsat7_2002_10,lsat7_2002_20,lsat7_2002_30,lsat7_2002_40,lsat7_2002_50 \
flier_color=blue bxcolor=green \
text_labels="2002 10,2002 20,2002 30,2002 40,2002 50"


This work was carried in the framework of the Save the tiger, save the grassland, save the water project by the Innovative Bio-Monitoring research group of the HAS University of Applied Sciences.


r.boxplot, d.vect.colbp, r.scatterplot, r.stats.zonal


Paulo van Breugel
Applied Geo-information Sciences
HAS University of Applied Sciences


Available at: r.series.boxplot source code (history)

Latest change: Thursday Apr 18 08:30:51 2024 in commit: dd45cdda69709801b71ecb6e83dda2e19b3340a5

Main index | Raster index | Topics index | Keywords index | Graphical index | Full index

© 2003-2024 GRASS Development Team, GRASS GIS 8.3.3dev Reference Manual