(self, event, annotation)
Update the specified annotation.
Update the specified annotation.
Update the specified annotation .
def update(self, event, annotation):
        """Update the specified annotation."""
        # Get artist-specific information about the pick event
        info = self.event_info(event)

        if self.props_override is not None:
            info = self.props_override(**info)

        # Update the xy position and text using the formatter function
        annotation.set_text(self.formatter(**info))
        annotation.xy = info['x'], info['y']

        # Unfortnately, 3D artists are a bit more complex...
        # Also, 3D artists don't share inheritance. Use naming instead.
        if '3D' in type(event.artist).__name__:
            annotation.xy = event.mouseevent.xdata, event.mouseevent.ydata

        # In case it's been hidden earlier...
        annotation.set_visible(True)

        if self.keep_inside:
            self._keep_annotation_inside(annotation)

        annotation._has_been_shown = True
        self._last_event = event
        self._last_annotation = annotation

        event.canvas.draw()
def update ( self , event , annotation ) : # Get artist-specific information about the pick event info = self . event_info ( event ) if self . props_override is not None : info = self . props_override ( * * info ) # Update the xy position and text using the formatter function annotation . set_text ( self . formatter ( * * info ) ) annotation . xy = info [ 'x' ] , info [ 'y' ] # Unfortnately, 3D artists are a bit more complex... # Also, 3D artists don't share inheritance. Use naming instead. if '3D' in type ( event . artist ) . __name__ : annotation . xy = event . mouseevent . xdata , event . mouseevent . ydata # In case it's been hidden earlier... annotation . set_visible ( True ) if self . keep_inside : self . _keep_annotation_inside ( annotation ) annotation . _has_been_shown = True self . _last_event = event self . _last_annotation = annotation event . canvas . draw ( )