plot_data_and_fits

plot_data_and_fits(result: ResultLike, wavelength: float, axis: Axis, 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, 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) None[source]

Plot data and fits for a given wavelength on a given axis.

If the wavelength isn’t part of a dataset, that dataset will be skipped.

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

  • wavelength (float) – Wavelength to plot data and fits for.

  • axis (Axis) – Axis to plot the data and fits on.

  • center_λ (float | None) – Center wavelength (λ 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.

  • 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.

See also

plot_fit_overview