hyperspy.drawing._markers.vertical_line_segment module

class hyperspy.drawing._markers.vertical_line_segment.VerticalLineSegment(x, y1, y2, **kwargs)

Bases: MarkerBase

Vertical line segment marker that can be added to the signal figure

Parameters:
  • x (array or float) – The position of line segment in x. 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.

  • y1 (array or float) – The position of the start of the line segment in x. see x1 arguments

  • y2 (array or float) – The position of the start of the line segment in y. see x1 arguments

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

Example

>>> im = hs.signals.Signal2D(np.zeros((100, 100)))
>>> m = hs.plot.markers.vertical_line_segment(
>>>     x=20, y1=30, y2=70, linewidth=4, color='red', linestyle='dotted')
>>> im.add_marker(m)

Add a marker permanently to a marker

>>> im = hs.signals.Signal2D(np.zeros((60, 60)))
>>> m = hs.plot.markers.vertical_line_segment(x=10, y1=20, y2=50)
>>> im.add_marker(m, permanent=True)