graphinglib.Histogram.from_fit_residuals#
- classmethod Histogram.from_fit_residuals(fit: Fit, bins: int, label: str | None = None, face_color: str | Inherit = Inherit, edge_color: str | Inherit = Inherit, hist_type: str | Inherit = Inherit, alpha: int | Inherit = Inherit, line_width: int | Inherit = Inherit, normalize: bool | Inherit = Inherit, orientation: str | Inherit = Inherit, show_params: bool | Inherit = Inherit) Self[source]#
Calculates the residuals of a fit and plots them as a histogram.
- Parameters:
- fitFit
The fit from which the residuals are to be calculated.
- binsint | ArrayLike
If bins is an integer, it defines the number of equal_width bins to be used in the histogram. If bins is an array, it defines the bin edges to be used in the histogram, including the left edge of the first bin and the right edge of the last bin.
- labelstr, optional
Label to be displayed in the legend.
- face_colorstr
Face color of the histogram. Default depends on the
figure_styleconfiguration.- edge_colorstr
Edge color of the histogram. Default depends on the
figure_styleconfiguration.- hist_typestr
Type of the histogram. Values are
"bar","barstacked","step", and"stepfilled". Default depends on thefigure_styleconfiguration.- alphafloat
Opacity of the histogram. Range is
0(transparent) to1(opaque). Default depends on thefigure_styleconfiguration.- line_widthfloat
Width of the histogram edge. Typical range is
0.5to3points. Default depends on thefigure_styleconfiguration.- normalizebool
Whether or not to normalize the histogram. Default depends on the
figure_styleconfiguration.- orientation: str
Whether to plot the histogram on x-axis or on y-axis. Values are
"vertical"and"horizontal". Default depends on thefigure_styleconfiguration.- show_paramsbool
Whether or not to show the mean and standard deviation of the data. Default depends on the
figure_styleconfiguration.
- Returns:
- A
Histogramobject created from the residuals of a fit.
- A
Notes
Color parameters accept Matplotlib color formats: named colors (
"blue"), short color strings ("b"), hex strings ("#0000ff"), grayscale strings ("0.5"), and RGB/RGBA tuples with values between0and1((0, 0, 1)or(0, 0, 1, 0.5)).