plot_fitted_traces

plot_fitted_traces(result: ResultLike, wavelengths: Iterable[float], axes_shape: tuple[int, int] = (4, 4), center_λ: float | None = None, main_irf_nr: int = 0, linlog: bool = False, linthresh: float = 1, divide_by_scale: bool = True, per_axis_legend: bool = False, figsize: tuple[float, float] = (30, 15), title: str = 'Fit overview', y_label: str = 'a.u.', cycler: Cycler | None = cycler('color', [<DataColorCode.grey: '#808080'>, <DataColorCode.black: '#000000'>, <DataColorCode.orange: '#ff8c00'>, <DataColorCode.red: '#ff0000'>, <DataColorCode.cyan: '#00ffff'>, <DataColorCode.blue: '#0000ff'>, <DataColorCode.green: '#00ff00'>, <DataColorCode.green4: '#008b00'>, <DataColorCode.magenta: '#ff00ff'>, <DataColorCode.indigo: '#4b0082'>, <DataColorCode.brown: '#964b00'>, <DataColorCode.maroon: '#800000'>, <DataColorCode.yellow: '#ffff00'>, <DataColorCode.orange: '#ff8c00'>]), show_zero_line: bool = True) tuple[Figure, Axes][source]

Plot data and their fit in per wavelength plot grid.

Parameters:
  • result (ResultLike) – Data structure which can be converted to a mapping of datasets.

  • wavelengths (Iterable[float]) – Wavelength which should be used for each subplot, should to be of length N*M with axes_shape being of shape (N, M), else it will result in missing plots.

  • axes_shape (tuple[int, int]) – Shape of the plot grid (N, M). Defaults to (4, 4).

  • center_λ (float | None) – Center wavelength of the IRF (λ in nm).

  • main_irf_nr (int) – Index of the main irf component when using an irf parametrized with multiple peaks. Defaults to 0.

  • linlog (bool) – Whether to use ‘symlog’ scale or not. Defaults to False.

  • linthresh (float) – A single float which defines the range (-x, x), within which the plot is linear. This avoids having the plot go to infinity around zero. Defaults to 1.

  • divide_by_scale (bool) – Whether or not to divide the data by the dataset scale used for optimization. Defaults to True.

  • per_axis_legend (bool) – Whether to use a legend per plot or for the whole figure. Defaults to False.

  • figsize (tuple[float, float]) – Size of the figure (N, M) in inches. Defaults to (30, 15).

  • title (str) – Title to add to the figure. Defaults to “Fit overview”.

  • y_label (str) – Label used for the y-axis of each subplot.

  • cycler (Cycler | None) – Plot style cycler to use. Defaults to PlotStyle().data_cycler_solid.

  • show_zero_line (bool) – Whether or not to add a horizontal line at zero. Defaults to True.

Returns:

Figure and axes which can then be refined by the user.

Return type:

tuple[Figure, Axes]

See also

maximum_coordinate_range, add_unique_figure_legend, plot_data_and_fits, calculate_wavelengths