hist

mdtools.plot.hist(ax, x, xmin=None, xmax=None, ymin=None, ymax=None, xlabel='$x$', ylabel='$y$', legend_loc='best', **kwargs)[source]

Plot a histogram to a matplotlib.axes.Axes object using matplotlib.axes.Axes.hist().

Deprecated since version 0.0.0.dev2: Use matplotlib.axes.Axes.hist(), matplotlib.axes.Axes.set() and matplotlib.axes.Axes.legend() directly.

Parameters:
  • ax (matplotlib.axes.Axes) – The axes to draw to.

  • x (array_like) – The data.

  • xmin (scalar, optional) – Left limit for plotting on x-axis. The left limit may be greater than the right limit, in which case the tick values will show up in decreasing order. Default is None, which means set the limit automatically.

  • xmax (scalar, optional) – Right limit for plotting on x-axis.

  • ymin, ymax (scalar, optional) – Same as xmin and xmax, but for the y-axis.

  • xlabel (str, optional) – Label for the x-axis.

  • ylabel (str, optional) – Label for the y-axis.

  • legend_loc (int or str, optional) – Position of the legend. See matplotlib.pyplot.legend() for possible arguments.

  • kwargs (dict, optional) – Keyword arguments to pass to matplotlib.axes.Axes.hist(). See there for possible keyword arguments.

Returns:

  • n (numpy.ndarray or list of numpy.ndarrays) – The values of the histogram bins.

  • bins (numpy.ndarray) – The edges of the bins.

  • patches (list or list of lists) – Silent list of individual patches used to create the histogram or list of such list if multiple input datasets.