This tool can be used to create a histogram, which is a graph displaying the frequency distribution of data, for the values contained in a field of a shapefile's attribute table. The user must specify the name of an input shapefile and the name of one of the fields contained it the associated attribute table. The user may optionally specify the number of bins used to create the histogram. If the specified field is non-numerical, the tool will produce a bar-chart of class frequency.
The following is an example of a Python script that uses this tool:
wd = pluginHost.getWorkingDirectory()
inputData = wd + "countries.shp" + ";" + "POPULATION"
numBins = "10"
args = [inputData, numBins]
pluginHost.runPlugin("AttributeHistogram", args, False)
This is a Groovy script also using this tool:
def wd = pluginHost.getWorkingDirectory()
def inputData = wd + "countries.shp" + ";" + "POPULATION"
// Note: the number of bins is not specified in this example
String[] args = [inputData]
pluginHost.runPlugin("AttributeHistogram", args, False)