hyperspy.drawing._markers.horizontal_line module

class hyperspy.drawing._markers.horizontal_line.HorizontalLine(y, **kwargs)

Bases: MarkerBase

Horizontal line marker that can be added to the signal figure

Parameters
  • y (array or float) – The position of the line. If float, the marker is fixed. If array, the marker will be updated when navigating. The array should have the same dimensions in the navigation axes.

  • kwargs – Keyword arguments are passed to matplotlib.axes.Axes.hlines().

Example

>>> s = hs.signals.Signal1D(np.random.random([10, 100])) * 10
>>> m = hs.plot.markers.horizontal_line(y=range(10), color='green')
>>> s.add_marker(m)

Adding a marker permanently to a signal

>>> s = hs.signals.Signal1D(np.random.random([10, 100]))
>>> m = hs.plot.markers.horizontal_line(y=5, color='green')
>>> s.add_marker(m, permanent=True)