- mcalf.visualisation.bar(class_map=None, vmin=None, vmax=None, reduce=True, style='original', cmap=None, ax=None, data=None)
Plot a bar chart of the classification abundances.
class_map (numpy.ndarray[int], ndim=2 or 3) – Array of classifications. If the array is three-dimensional, it is assumed that the first dimension is time, and a time average classification will be plotted. The time average is the most common positive (valid) classification at each pixel.
vmin (int, optional, default=None) – Minimum classification integer to plot. Must be greater or equal to zero. Defaults to min positive integer in class_map.
vmax (int, optional, default=None) – Maximum classification integer to plot. Must be greater than zero. Defaults to max positive integer in class_map.
reduce (bool, optional, default=True) – Whether to perform the time average described in class_map info.
style (str, optional, default='original') – The named matplotlib colormap to extract a
ListedColormapfrom. Colours are selected from vmin to vmax at equidistant values in the range [0, 1]. The
ListedColormapproduced will also show bad classifications and classifications out of range in grey. The default ‘original’ is a special case used since early versions of this code. It is a hardcoded list of 5 colours. When the number of classifications exceeds 5,
style='viridis'will be used.
ax (matplotlib.axes.Axes, optional, default=None) – Axes into which the velocity map will be plotted. Defaults to the current axis of the current figure.
b – The object returned by
matplotlib.axes.Axes.bar()after plotting abundances.
- Return type
Average a 3D array of classifications.
Visualisation assumes that all integers between vmin and vmax are valid classifications, even if they do not appear in class_map.