vispipe.plot_backend.MPL_Figure.hist#

MPL_Figure.hist(vals, bins, cmap=None, valsrange=None, empty_value=-99999, ax=None, **histkwargs)#

Calls ax.hist().

Parameters:
  • vals (np.ndarray) – Array containing data to be plotted.

  • bins (int | list | {"auto", "fd", "doane", "scott", "stone", "rice", "sturges", "sqrt"}) – Tells ax.hist() how to bin the data. If bins is an int it is the number of bins used. If it is a list it is the edges used by each bin including the extreme left and right edges. Stings used by np.histogram_bin_edges can also be used.

  • cmap (str | None) – If a Colormap is provided each patch in the histogram has its facecolor changed to its relative color in cmap.

  • bbox (list[x0,y0,x1,y1] | None, optional) – typing.Iterable containing x0,y0,x1,y1 where point 0 is the bottem left and point 1 is the top right of the bounding box.

  • valsrange (tuple[float, float] | None) – If provided, only values with [valsrange[0],valsrange[1]] will be plotted.

  • empty_value (float | None, default=-99999) – Value that will be masked out before the plot.

  • ax (Axes | None) – Axes`to plot onto. If `None self.gca() is called.

  • **histkwargs – Keyword arguments passed to ax.hist().

Return type:

tuple[ndarray | list[ndarray], ndarray, BarContainer | list[Polygon]]

Returns:

  • n (np.ndarray | list[np.ndarray,…]) – Value of each bin.

  • bins (np.ndarray) – Edges of each bin.

  • patches (BarContainer | list[Polygon,…]) – The artists used in the plot.