(self, x=None, y=None, z=None, s=None, label=None, **kwargs)
return u'\n'.join(output)
Default formatter function, if no `formatter` kwarg is specified. Takes
        information about the pick event as a series of kwargs and returns the
        string to be displayed.
Default formatter function, if no `formatter` kwarg is specified. Takes
        information about the pick event as a series of kwargs and returns the
        string to be displayed.
Default formatter function if no formatter kwarg is specified . Takes information about the pick event as a series of kwargs and returns the string to be displayed .
def _formatter(self, x=None, y=None, z=None, s=None, label=None, **kwargs):
        """
        Default formatter function, if no `formatter` kwarg is specified. Takes
        information about the pick event as a series of kwargs and returns the
        string to be displayed.
        """
        def is_date(axis):
            fmt = axis.get_major_formatter()
            return (isinstance(fmt, mdates.DateFormatter)
                 or isinstance(fmt, mdates.AutoDateFormatter))
        def format_date(num):
            if num is not None:
                return mdates.num2date(num).strftime(self.date_format)

        ax = kwargs['event'].artist.axes

        # Display x and y with range-specific formatting
        if is_date(ax.xaxis):
            x = format_date(x)
        else:
            limits = ax.get_xlim()
            x = self._format_coord(x, ax.xaxis)
            kwargs['xerror'] = self._format_coord(kwargs.get('xerror'), ax.xaxis)

        if is_date(ax.yaxis):
            y = format_date(y)
        else:
            limits = ax.get_ylim()
            y = self._format_coord(y, ax.yaxis)
            kwargs['yerror'] = self._format_coord(kwargs.get('yerror'), ax.yaxis)

        output = []
        for key, val in zip(['x', 'y', 'z', 's'], [x, y, z, s]):
            if val is not None:
                try:
                    output.append(u'{key}: {val:0.3g}'.format(key=key, val=val))
                except ValueError:
                    # X & Y will be strings at this point.
                    # For masked arrays, etc, "z" and s values may be a string
                    output.append(u'{key}: {val}'.format(key=key, val=val))

        # label may be None or an empty string (for an un-labeled AxesImage)...
        # Un-labeled Line2D's will have labels that start with an underscore
        if label and not label.startswith('_'):
            output.append(u'Label: {}'.format(label))

        if kwargs.get(u'point_label', None) is not None:
            output.append(u'Point: ' + u', '.join(kwargs['point_label']))

        for arg in ['xerror', 'yerror']:
            val = kwargs.get(arg, None)
            if val is not None:
                output.append(u'{}: {}'.format(arg, val))

        return u'\n'.join(output)
def _formatter ( self , x = None , y = None , z = None , s = None , label = None , * * kwargs ) : def is_date ( axis ) : fmt = axis . get_major_formatter ( ) return ( isinstance ( fmt , mdates . DateFormatter ) or isinstance ( fmt , mdates . AutoDateFormatter ) ) def format_date ( num ) : if num is not None : return mdates . num2date ( num ) . strftime ( self . date_format ) ax = kwargs [ 'event' ] . artist . axes # Display x and y with range-specific formatting if is_date ( ax . xaxis ) : x = format_date ( x ) else : limits = ax . get_xlim ( ) x = self . _format_coord ( x , ax . xaxis ) kwargs [ 'xerror' ] = self . _format_coord ( kwargs . get ( 'xerror' ) , ax . xaxis ) if is_date ( ax . yaxis ) : y = format_date ( y ) else : limits = ax . get_ylim ( ) y = self . _format_coord ( y , ax . yaxis ) kwargs [ 'yerror' ] = self . _format_coord ( kwargs . get ( 'yerror' ) , ax . yaxis ) output = [ ] for key , val in zip ( [ 'x' , 'y' , 'z' , 's' ] , [ x , y , z , s ] ) : if val is not None : try : output . append ( u'{key}: {val:0.3g}' . format ( key = key , val = val ) ) except ValueError : # X & Y will be strings at this point. # For masked arrays, etc, "z" and s values may be a string output . append ( u'{key}: {val}' . format ( key = key , val = val ) ) # label may be None or an empty string (for an un-labeled AxesImage)... # Un-labeled Line2D's will have labels that start with an underscore if label and not label . startswith ( '_' ) : output . append ( u'Label: {}' . format ( label ) ) if kwargs . get ( u'point_label' , None ) is not None : output . append ( u'Point: ' + u', ' . join ( kwargs [ 'point_label' ] ) ) for arg in [ 'xerror' , 'yerror' ] : val = kwargs . get ( arg , None ) if val is not None : output . append ( u'{}: {}' . format ( arg , val ) ) return u'\n' . join ( output )