EELSFitter.plotting package

EELSFitter.plotting.hyperparameters module

EELSFitter.plotting.hyperparameters.plot_figs(dpi=200, x=0, y=0, xlim=[0.4, 5], ylim=[-500, 500], yscale='linear', **kwargs)[source]

General parameters to plot figures

Parameters:
  • dpi

  • x

  • y

  • xlim

  • ylim

  • yscale

  • kwargs

Returns:

fig

Return type:

matplotlib.figure.Figure

EELSFitter.plotting.hyperparameters.plot_hp(eaxis, clusters_data, de1, de2, cmap='coolwarm', **kwargs)[source]

Plot with location of dE1 & dE2 shown on top of the clusters.

Parameters:
  • eaxis (numpy.ndarray, shape=(M,)) – eaxis of the data

  • clusters_data (numpy.ndarray, shape=(M,N)) – Data per cluster

  • de1 (float) – Hyperparameter dE1

  • de2 (float) – Hyperparameter dE2

  • **kwargs (dictionary) – Additional keyword arguments.

Returns:

fig

Return type:

matplotlib.figure.Figure

EELSFitter.plotting.zlp module

EELSFitter.plotting.zlp.plot_figs(dpi=200, x=0, y=0, xlim=[0, 5], ylim=[-10, 3000], yscale='linear', **kwargs)[source]

General parameters to plot figures

Parameters:
  • dpi

  • x

  • y

  • xlim

  • ylim

  • yscale

  • kwargs

Returns:

fig

Return type:

matplotlib.figure.Figure

EELSFitter.plotting.zlp.plot_zlp_cluster_predictions(image, cmap='coolwarm', **kwargs)[source]
Parameters:
  • image

  • cmap

  • kwargs

EELSFitter.plotting.zlp.plot_zlp_per_cluster(image, cluster, signal_type='EELS', zlp_gen=True, hyper_par=True, smooth=False, **kwargs)[source]
Parameters:
  • image

  • cluster

  • signal_type

  • zlp_gen

  • hyper_par

  • kwargs

EELSFitter.plotting.zlp.plot_zlp_per_pixel(image, pixx, pixy, signal_type='EELS', zlp_gen=False, zlp_match=True, subtract=False, deconv=True, hyper_par=True, random_zlp=None, **kwargs)[source]

Plots for pixx, pixy

  • the inelastic scattering distribution plus uncertainties

  • the ZLP plus uncertainties

  • the raw signal

Parameters:
  • image

  • pixx

  • pixy

  • signal

  • zlp_gen

  • zlp_match

  • subtract

  • deconv

  • hyper_par

  • random_zlp

  • kwargs

EELSFitter.plotting.zlp.summary_distribution(data, mean=50, lower=16, upper=84)[source]

EELSFitter.plotting.training_perf module

EELSFitter.plotting.training_perf.plot_cost_dist(cost_trains, cost_tests, cost_tests_std, title='$\\rm{Cost\\;distribution\\;}$')[source]
Parameters:
  • cost_trains (numpy.ndarray, shape=(M,)) – Cost values of the training set with M trained NNs

  • cost_tests (numpy.ndarray, shape=(M,)) – Cost values of the test set with M trained NNs

  • cost_tests_std (float) – 68% CL of the test costs

  • title (str, optional) – Title of the plot

Returns:

fig

Return type:

matplotlib.figure.Figure

EELSFitter.plotting.heatmaps module

EELSFitter.plotting.heatmaps.get_ticks(image, sig_ticks=2, npix_xtick=10, npix_ytick=10, scale_ticks=1, tick_int=False)[source]

Sets the proper tick labels and tick positions for the heatmap plots.

Parameters:
  • sig_ticks (int, optional) – Set the amount of significant numbers displayed in the ticks. The default is 2.

  • npix_xtick (float, optional) – Display a tick per n pixels in the x-axis. Note that this value can be a float. The default is 10.

  • npix_ytick (float, optional) – Display a tick per n pixels in the y-axis. Note that this value can be a float. The default is 10.

  • scale_ticks (float, optional) – Change the scaling of the numbers displayed in the ticks. Microns ([u03BCm]) are assumed as standard scale, adjust scaling from there. The default is 1.

  • tick_int (bool, optional) – Set whether you only want the ticks to display as integers instead of floats. The default is False.

Returns:

  • xticks (numpy.ndarray, shape=(M,)) – Array of the xticks positions.

  • yticks (numpy.ndarray, shape=(M,)) – Array of the yticks positions.

  • xticks_labels (numpy.ndarray, shape=(M,)) – Array with strings of the xtick labels.

  • yticks_labels (numpy.ndarray, shape=(M,)) – Array with strings of the ytick labels.

EELSFitter.plotting.heatmaps.plot_heatmap(image, data, dpi=200, title=None, xlabel='$\\rm{[nm]\\;}$', ylabel='$\\rm{[nm]\\;}$', cmap='coolwarm', discrete_colormap=False, sig_cbar=3, color_bin_size=None, sig_ticks=2, npix_xtick=10, npix_ytick=10, scale_ticks=1, tick_int=False, save_as=False, **kwargs)[source]

Plots a heatmap for given data input.

Parameters:
  • image (SpectralImage) – spectral_image.SpectralImage object

  • data (numpy.ndarray, shape=(M,N)) – Input data for heatmap, but be 2D.

  • dpi (int, optional) – Set the dpi of the heatmap. The default is 100

  • title (str, optional) – Set the title of the heatmap. The default is None.

  • xlabel (str, optional) – Set the label of the x-axis. Nanometer ([nm]) is assumed as standard scale. The default is ‘[nm]’.

  • ylabel (str, optional) – Set the label of the y-axis. Nanometer ([nm]) is assumed as standard scale. The default is ‘[nm]’.

  • cmap (str, optional) – Set the colormap of the heatmap. The default is ‘coolwarm’.

  • discrete_colormap (bool, optional) – Enables the heatmap values to be discretised. Best used in conjuction with color_bin_size. The default is False.

  • sig_cbar (int, optional) – Set the amount of significant numbers displayed in the colorbar. The default is 3.

  • color_bin_size (float, optional) – Set the size of the bins used for discretisation. Best used in conjuction discrete_colormap. The default is None.

  • sig_ticks (int, optional) – Set the amount of significant numbers displayed in the ticks. The default is 2.

  • npix_xtick (float, optional) – Display a tick per n pixels in the x-axis. Note that this value can be a float. The default is 10.

  • npix_ytick (float, optional) – Display a tick per n pixels in the y-axis. Note that this value can be a float. The default is 10.

  • scale_ticks (float, optional) – Change the scaling of the numbers displayed in the ticks. Nanometer ([nm]) is assumed as standard scale adjust scaling from there. The default is 1.

  • tick_int (bool, optional) – Set whether you only want the ticks to display as integers instead of floats. The default is False.

  • save_as (str, optional) – Set the location and name for the heatmap to be saved to. The default is False.

  • **kwargs (dictionary) – Additional keyword arguments.

Returns:

fig

Return type:

Seaborn.figure.Figure