utils

Module containing plotting utility functionality.

Functions

Summary

abs_max

Calculate the absolute maximum values of data along all dims except result_dims.

add_cycler_if_not_none

Add cycler to and axis if it is not None.

add_subplot_labels

Add labels to all subplots in axes in a consistent manner.

add_unique_figure_legend

Add a legend with unique elements sorted by label to a figure.

calculate_ticks_in_units_of_pi

Calculate tick values and labels in units of Pi.

ensure_axes_array

Ensure that axes have flatten method even if it is a single axis.

extract_dataset_scale

Extract 'dataset_scale' attribute from optimization result dataset.

extract_irf_dispersion_center

Extract the IRF dispersion center data from a result dataset where irf_nr==irf_nr_index.

extract_irf_location

Determine location of the irf, which can be used to shift plots.

format_sub_plot_number_upper_case_letter

Format sub_plot_number into an upper case letter, that can be used as label.

get_shifted_traces

Shift traces by the position of the main irf.

get_subplot_label_format_function

Get subplot label function from BuiltinSubPlotLabelFormatFunctions if it is a key.

maximum_coordinate_range

Calculate the minimal and maximal values of a coordinate across datasets.

not_single_element_dims

Names of dimensions in data which don't have a size equal to one.

select_irf_dispersion_center_by_index

Select a subset of the IRF dispersion data where irf_nr==main_irf_nr.

select_plot_wavelengths

Select wavelengths to be used in plot_fit_overview from a result.

shift_time_axis_by_irf_location

Shift plot_data 'time' axis by the position of the main irf.

Classes

Summary

MinorSymLogLocator

Dynamically find minor tick positions based on major ticks for a symlog scaling.

Exceptions

Exception Summary

PlotDuplicationWarning

Warning given when there are more subplots than datapoints.