csep.utils.plots.plot_histogram

csep.utils.plots.plot_histogram(simulated, observation, bins='fd', percentile=None, show=False, axes=None, catalog=None, plot_args=None)[source]

Plots histogram of single statistic for stochastic event sets and observations. The function will behave differently depending on the inumpyuts.

Simulated should always be either a list or numpy.array where there would be one value per data in the stochastic event set. Observation could either be a scalar or a numpy.array/list. If observation is a scale a vertical line would be plotted, if observation is iterable a second histogram would be plotted.

This allows for comparisons to be made against catalogs where there are multiple values e.g., magnitude, and single values e.g., event count.

If an axis handle is included, additional function calls will only addition extra simulations, observations will not be plotted. Since this function returns an axes handle, any extra modifications to the figure can be made using that.

Parameters:
  • simulated (numpy.arrays) – numpy.array like representation of statistics computed from catalogs.

  • observation (numpy.array or scalar) – observation to plot against stochastic event set

  • filename (str) – filename to save figure

  • show (bool) – show interactive version of the figure

  • ax (axis object) – axis object with interface defined by matplotlib

  • catalog (csep.AbstractBaseCatalog) – used for annotating the figures

  • plot_args (dict) – additional plotting commands. TODO: Documentation

Returns:

matplolib axes handle

Return type:

axis