(self, event)
Update an existing box or create an annotation box for an event.
Update an existing box or create an annotation box for an event.
Update an existing box or create an annotation box for an event .
def _show_annotation_box(self, event):
        """Update an existing box or create an annotation box for an event."""
        ax = event.artist.axes
        # Get the pre-created annotation box for the axes or create a new one.
        if self.display != 'multiple':
            annotation = self.annotations[ax]
        elif event.mouseevent in self.annotations:
            # Avoid creating multiple datacursors for the same click event
            # when several artists are selected.
            annotation = self.annotations[event.mouseevent]
        else:
            annotation = self.annotate(ax, **self._annotation_kwargs)
            self.annotations[event.mouseevent] = annotation

        if self.display == 'single':
            # Hide any other annotation boxes...
            for ann in self.annotations.values():
                ann.set_visible(False)

        self.update(event, annotation)
def _show_annotation_box ( self , event ) : ax = event . artist . axes # Get the pre-created annotation box for the axes or create a new one. if self . display != 'multiple' : annotation = self . annotations [ ax ] elif event . mouseevent in self . annotations : # Avoid creating multiple datacursors for the same click event # when several artists are selected. annotation = self . annotations [ event . mouseevent ] else : annotation = self . annotate ( ax , * * self . _annotation_kwargs ) self . annotations [ event . mouseevent ] = annotation if self . display == 'single' : # Hide any other annotation boxes... for ann in self . annotations . values ( ) : ann . set_visible ( False ) self . update ( event , annotation )