hyperspy.drawing._widgets.circle module

class hyperspy.drawing._widgets.circle.CircleWidget(axes_manager, **kwargs)

Bases: hyperspy.drawing.widget.Widget2DBase, hyperspy.drawing.widget.ResizersMixin

CircleWidget is a symmetric, Cicle-patch based widget, which can be dragged, and resized by keystrokes/code.


Returns the xy coordinates of the patch. In this implementation, the patch is centered on the position.


Get the positions of the resizer handles.


on mouse motion move the patch if picked


Sets the patch to a matplotlib Circle with the correct geometry. The geometry is defined by _get_patch_xy, and size.


Setter for the ‘size’ property. Calls _size_changed to handle size change, if the value has changed.


Updates all geometry of the patch on the plot.


Updates the position of the patch on the plot.


Updates the size of the patch on the plot.


Constrict the position within bounds.


Decrement all sizes by one step. Applied via ‘size’ property.


Gets the center indices. The default implementation is simply the position + half the size in axes space, which should work for any symmetric widget, but more advanced widgets will need to decide whether to return the center of gravity or the geometrical center of the bounds.


Gets the size property converted to the index space (via ‘axes’ attribute).


Increment all sizes by one step. Applied via ‘size’ property.