hyperspy.drawing._markers.ellipse module

class hyperspy.drawing._markers.ellipse.Ellipse(x, y, width, height, **kwargs)

Bases: MarkerBase

Ellipse marker that can be added to the signal figure

Parameters:
  • x (array or float) – The position of the center of ellipse 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.

  • y (array or float) – The position of the center of ellipse in y. see x arguments

  • width (array or float) – The width (diameter) of the ellipse in x. see x arguments

  • height (array or float) – The height (diameter) of the ellipse in y. see x arguments

  • kwargs – Keyword arguments are passed to matplotlib.patches.Ellipse.

Example

>>> import skimage
>>> im = hs.signals.Signal2D(skimage.data.camera())
>>> m = hs.plot.markers.ellipse(x=150, y=100, width=400, height=400,
>>>                             edgecolor='red', facecolor='white', fill=True)
>>> im.add_marker(m)

Adding a marker permanently to a signal

>>> im = hs.signals.Signal2D(np.random.random((50, 50))
>>> m = hs.plot.markers.ellipse(x=20, y=30, width=40, height=49)
>>> im.add_marker(m, permanent=True)