Plotting

EVA.core.plot.plotting.Plot_Peak_Location(ax, x, y, peak_indices)

Plots the peak location for each peak specified in peak_indices on a specified Axes instance.

Parameters:
  • ax (Axes) – axis to plot peaks on

  • x (ndarray) – input x-data

  • y (ndarray) – input y-data

  • peak_indices (ndarray) – indices of data arrays to plot peaks on

EVA.core.plot.plotting.get_ylabel(normalisation)

Returns the appropriate ylabel for given normalisation :type normalisation: str :param normalisation: normalisation type

Return type:

str

Returns:

formatted ylabel

EVA.core.plot.plotting.plot_group_components(run, axs, group_name, show_components=False)

Plots the components of a detector group on a specified Axes instance.

Parameters:
  • run (Run) – Run object containing the data

  • axs (Axes) – Axes instance to plot on

  • group_name (str) – Name of the detector group to plot

  • show_components (bool) – Whether to show individual component plots

  • **settings –

    • colour (str): plot fill colour (default is yellow)

EVA.core.plot.plotting.plot_run(run, fig, **settings)

Plots a Run with a subplot for each Spectrum in the Run.

Parameters:
  • run (Run) – Run object to plot

  • **settings (dict) –

    • show_detectors (list): which detectors to plot (default is all loaded detectors)

    • title (str): plot title

    • colour (str): plot fill colour (default is yellow)

    • size (tuple): plot size (default is (16, 7))

    • adjustment_dict (dict): plot adjustments for plt.subplots_adjust()

Return type:

tuple[Figure, Axes]

Returns:

matplotlib Figure and Axes with plotted data

EVA.core.plot.plotting.plot_spectrum(spectrum, normalisation, **settings)

Plots a single spectrum (for a single detector).

Parameters:
  • spectrum (Spectrum) – Spectrum object to plot

  • normalisation (str) – Normalisation type - valid options are “counts”, “none”, “spills”

  • **settings (dict) –

    • title (str): plot title

    • colour (str): plot fill colour

Return type:

tuple[Figure, Axes]

Returns:

matplotlib Figure and Axes with plotted spectrum

EVA.core.plot.plotting.plot_spectrum_residual(run, detector, normalisation, **settings)

Plots a single spectrum (for a single detector) and creates an empty plot to be populated with fit residuals.

Parameters:
  • run (Run) – Run object to plot

  • normalisation (str) – Normalisation type - valid options are “counts”, “none”, “spills”

  • **settings (dict) –

    • title (str): plot title

    • colour (str): plot fill colour

Return type:

tuple[Figure, Axes]

Returns:

matplotlib Figure and Axes with plotted spectrum and empty Axis for residuals