lib5c.plotters.fits module¶
Module for plotting visualizations comparing fitted theoretical distributions to real data.
-
lib5c.plotters.fits.
plot_fit
(data, frozen_dist, legend=True, **kwargs)[source]¶ Base function for plotting fits.
Parameters: - data (np.ndarray) – The real data to be compared to the theoretical distribution.
- frozen_dist (scipy.stats.rv_frozen) – The theoretical distribution to be compared to the real data.
- kwargs (kwargs) – Typical plotter kwargs.
Returns: The axis plotted on.
Return type: pyplot axis
-
lib5c.plotters.fits.
plot_group_fit
(obs, exp, i, j, frozen_dist, local=False, p=5, w=15, group_fractional_tolerance=0.1, vst=False, log=False, legend=True, **kwargs)[source]¶ Convenience function to select a subset of some data and compare it to a frozen distribution via plot_fit().
Parameters: - obs (np.ndarray) – Regional matrix of the observed values.
- exp (np.ndarray) – Regional matrix of the expected values.
- j (i,) – Row and column indices, respectively, of the target point.
- frozen_dist (scipy.stats.rv_frozen) – The theoretical distribution to be compared to the real data.
- local (bool) – Pass True to compare the theoretical distribution to observed data points in a donut window around the target point. Pass False to compare the theoretical distribution to observed data points with similar expected values to the target point.
- w (int) – The outer radius of the donut window to use when local=True.
- p (int) – The inner radius of the donut window to use when local=True.
- group_fractional_tolerance (float) – The fractional tolerance in expected value used to select points with “similar” expected values when local=False.
- vst (bool) – Pass True if a VST-style step has been performed upstream and the expected values should be interpreted as already logged.
- log (bool) – Pass True to log the selected observed data points before plotting.
- kwargs (kwargs) – Typical plotter kwargs.
Returns: The axis plotted on.
Return type: pyplot axis