hyperspy.drawing._markers.arrow module
- class hyperspy.drawing._markers.arrow.Arrow(x1, y1, x2, y2, **kwargs)
Bases:
MarkerBase
Arrow marker that can be added to the signal figure
- Parameters:
x1 (array or float) – The position of the tail of the arrow 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 tail of the arrow in y. see x1 arguments
x2 (array or float) – The position of the head of the arrow in x. see x1 arguments
y2 (array or float) – The position of the head of the arrow in y. see x1 arguments
kwargs – Keyword arguments are passed to
matplotlib.patches.FancyArrowPatch
.
Example
>>> import skimage >>> im = hs.signals.Signal2D(skimage.data.camera()) >>> m = hs.plot.markers.arrow(x1=150, y1=100, x2=400, y2=400, >>> arrowprop={'arrowstyle':'<->', edgecolor='red'}) >>> im.add_marker(m)
Adding a marker permanently to a signal
>>> im.add_marker(m, permanent=True)