osyris.hist1d#
- osyris.hist1d(*layers, bins=50, weights=None, logx=False, logy=False, loglog=False, filename=None, title=None, ymin=None, ymax=None, ax=None, **kwargs)#
Plot a 1D histogram with arbitrary number of variables as input. When a vector quantity is supplied, the function will histogram the norm of the vectors.
This function has an API very close to that of matplotlib’s
histfunction. For the documentation of any parameters that are not listed below, see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.hist.html.- Parameters:
layers (Iterable | Array) – Dicts or Arrays representing the quantities to be mapped onto the colormap of the generated image.
bins (int | Iterable) – The number of bins to use. Default is 50. Can also be an array of bin edges. If a single integer is passed, the bin edges are determined automatically.
weights (Array | None) – An array of the same length as the data, representing the weights of each data point. Default is
None, meaning all weights are 1.logx (bool) – If
True, use logarithmic scaling on the horizontal axis. Default isFalse.logy (bool) – If
True, use logarithmic scaling on the vertical axis. Default isFalse.loglog (bool) – If
True, use logarithmic scaling on the horizontal and vertical axes. Default isFalse.filename (str | None) – If specified, the returned figure is also saved to file. Default is
None.title (str | None) – The title of the figure. Default is
None.ymin (float | None) – Minimum value for the vertical axis. Default is
None.ymax (float | None) – Maximum value for the vertical axis. Default is
None.ax (object | None) – A matplotlib axes inside which the figure will be plotted. Default is
None, in which case some new axes a created.
- Return type:
Plot