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.

_get_patch_xy()

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

_get_resizer_pos()

Get the positions of the resizer handles.

_onmousemove(event)

on mouse motion move the patch if picked

_set_patch()

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

_set_size(value)

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

_update_patch_geometry()

Updates all geometry of the patch on the plot.

_update_patch_position()

Updates the position of the patch on the plot.

_update_patch_size()

Updates the size of the patch on the plot.

_validate_pos(value)

Constrict the position within bounds.

decrease_size()

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

get_centre()

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.

get_size_in_indices()

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

increase_size()

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