MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / __init__

Method __init__

lib/matplotlib/widgets.py:3408–3472  ·  view source on GitHub ↗
(self, ax, onselect=None, *, minspanx=0,
                 minspany=0, useblit=False,
                 props=None, spancoords='data', button=None, grab_range=10,
                 handle_props=None, interactive=False,
                 state_modifier_keys=None, drag_from_anywhere=False,
                 ignore_event_outside=False, use_data_coordinates=False)

Source from the content-addressed store, hash-verified

3406 """
3407
3408 def __init__(self, ax, onselect=None, *, minspanx=0,
3409 minspany=0, useblit=False,
3410 props=None, spancoords='data', button=None, grab_range=10,
3411 handle_props=None, interactive=False,
3412 state_modifier_keys=None, drag_from_anywhere=False,
3413 ignore_event_outside=False, use_data_coordinates=False):
3414 super().__init__(ax, onselect, useblit=useblit, button=button,
3415 state_modifier_keys=state_modifier_keys,
3416 use_data_coordinates=use_data_coordinates)
3417
3418 self._interactive = interactive
3419 self.drag_from_anywhere = drag_from_anywhere
3420 self.ignore_event_outside = ignore_event_outside
3421 self._rotation = 0.0
3422 self._aspect_ratio_correction = 1.0
3423
3424 # State to allow the option of an interactive selector that can't be
3425 # interactively drawn. This is used in PolygonSelector as an
3426 # interactive bounding box to allow the polygon to be easily resized
3427 self._allow_creation = True
3428
3429 if props is None:
3430 props = dict(facecolor='red', edgecolor='black',
3431 alpha=0.2, fill=True)
3432 props = {**props, 'animated': self._useblit}
3433 self._visible = props.pop('visible', self._visible)
3434 to_draw = self._init_shape(**props)
3435 self.ax.add_patch(to_draw)
3436
3437 self._selection_artist = to_draw
3438 self._set_aspect_ratio_correction()
3439
3440 self.minspanx = minspanx
3441 self.minspany = minspany
3442
3443 _api.check_in_list(['data', 'pixels'], spancoords=spancoords)
3444 self.spancoords = spancoords
3445
3446 self.grab_range = grab_range
3447
3448 if self._interactive:
3449 self._handle_props = {
3450 'markeredgecolor': (props or {}).get('edgecolor', 'black'),
3451 **cbook.normalize_kwargs(handle_props, Line2D)}
3452
3453 self._corner_order = ['SW', 'SE', 'NE', 'NW']
3454 xc, yc = self.corners
3455 self._corner_handles = ToolHandles(self.ax, xc, yc,
3456 marker_props=self._handle_props,
3457 useblit=self._useblit)
3458
3459 self._edge_order = ['W', 'S', 'E', 'N']
3460 xe, ye = self.edge_centers
3461 self._edge_handles = ToolHandles(self.ax, xe, ye, marker='s',
3462 marker_props=self._handle_props,
3463 useblit=self._useblit)
3464
3465 xc, yc = self.center

Callers

nothing calls this directly

Calls 7

_init_shapeMethod · 0.95
ToolHandlesClass · 0.85
add_patchMethod · 0.80
__init__Method · 0.45
popMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected