@@ -383,7 +383,7 @@ def _default_contains(self, mouseevent, figure=None):
383
383
"""
384
384
Base impl. for checking whether a mouseevent happened in an artist.
385
385
386
- 1. If the artist defines a custom checker, use it.
386
+ 1. If the artist defines a custom checker, use it (deprecated) .
387
387
2. If the artist figure is known and the event did not occur in that
388
388
figure (by checking its ``canvas`` attribute), reject it.
389
389
3. Otherwise, return `None, {}`, indicating that the subclass'
@@ -396,7 +396,7 @@ def _default_contains(self, mouseevent, figure=None):
396
396
return inside, info
397
397
# subclass-specific implementation follows
398
398
399
- The `canvas` kwarg is provided for the implementation of
399
+ The *figure* kwarg is provided for the implementation of
400
400
`Figure.contains`.
401
401
"""
402
402
if callable (self ._contains ):
@@ -406,7 +406,8 @@ def _default_contains(self, mouseevent, figure=None):
406
406
return None , {}
407
407
408
408
def contains (self , mouseevent ):
409
- """Test whether the artist contains the mouse event.
409
+ """
410
+ Test whether the artist contains the mouse event.
410
411
411
412
Parameters
412
413
----------
@@ -420,17 +421,14 @@ def contains(self, mouseevent):
420
421
An artist-specific dictionary of details of the event context,
421
422
such as which points are contained in the pick radius. See the
422
423
individual Artist subclasses for details.
423
-
424
- See Also
425
- --------
426
- set_contains, get_contains
427
424
"""
428
425
inside , info = self ._default_contains (mouseevent )
429
426
if inside is not None :
430
427
return inside , info
431
428
_log .warning ("%r needs 'contains' method" , self .__class__ .__name__ )
432
429
return False , {}
433
430
431
+ @cbook .deprecated ("3.3" , alternative = "set_picker" )
434
432
def set_contains (self , picker ):
435
433
"""
436
434
Define a custom contains test for the artist.
@@ -458,6 +456,7 @@ def contains(artist: Artist, event: MouseEvent) -> bool, dict
458
456
raise TypeError ("picker is not a callable" )
459
457
self ._contains = picker
460
458
459
+ @cbook .deprecated ("3.3" , alternative = "get_picker" )
461
460
def get_contains (self ):
462
461
"""
463
462
Return the custom contains function of the artist if set, or *None*.
0 commit comments