DESCRIPTION

d.vect.colbp draws a boxplot of the values in a vector map attribute column. The user can use the where option to only select a subset of the attribute table. There is also the option to group the values of the column according to the categories in a second column (group_by and create one plot with for each group a separate boxplot.

By default, the resulting plot is displayed on screen (default). However, the user can also save the plot to file using the plot_output option. The format is determined by the extension given by the user. So, if plot_output = outputfile.png, the plot will be saved as a png file.

There are a few additonal layout options, including the option to rotate the plot and the x-axis labels. Furthermore, the user can optinally plot the boxplot(s) with notches and without outliers.

NOTE

This script, based on d.vect.colhist, is a quick and dirty solution using basic matplotlib, and will need some further fine-tuning and testing.

EXAMPLE

Example 1

Use the vector layer schools_wake from the NC sample dataset to create boxplots of the core capacity of the schools in Wake County, North Carolina. Use the Where clause to exclude all records with no data.
d.vect.colbp -n map=schools_wake column=CORECAPACI where="CORECAPACI >0"


Figure 1: Boxplot of core capacity of schools in Wake County.

Example 2

Use the vector layer schools_wake from the NC sample dataset to create boxplots of the core capacity of the schools in Wake County, North Carolina, grouped by city. Use the Where clause to exclude all records with no data.
d.vect.colbp -h --overwrite map=schools_wake column=CORECAPACI where="CORECAPACI >0" group_by=ADDRCITY order=ascending
	


Figure 2" Boxplot of core capacity of schools in Wake County, grouped by city.

AUTHOR

Paulo van Breugel
Based on the d.vect.colhist addon by Moritz Lennert

Last changed: $Date$