hyperspy.misc.label_position module

class hyperspy.misc.label_position.SpectrumLabelPosition(signal)

Bases: object

A class to get the positions of labels in spectrums such as EELS, EDX, XRF. The main method is the get_markers method which the user supplies a dictionary of edge labels specifying its energy positions, and it returns markers for labelling them.

_get_bbox_from_text_artist(text)
Parameters:

text (matplotlib.text.Text instance) –

get_markers(labels)

Get the markers (vertical line segment and text box) for labelling the edges

Parameters:

labels (dictionary) – A dictionary with the labels as keys and their energies as values. E.g. for EELS edges it could be {‘Mn_L2’: 651.0, ‘Cr_L3’: 575.0}.

Returns:

  • vls (list) – A list contains HyperSpy’s vertical line segment marker

  • txs (list) – A list contains HyperSpy’s text marker