(self, values, scale, spacing)
return [utc_from_timestamp(x).strftime(fmt) for x in values]
Format tick values according to space between them.
Format tick values according to space between them.
Format tick values according to space between them .
def tickStrings(self, values, scale, spacing):
        """Format tick values according to space between them."""
        if not self._use_time:
            return super().tickStrings(values, scale, spacing)

        if spacing >= 3600 * 24 * 365:
            fmt = "%Y"
        elif spacing >= 3600 * 24 * 28:
            fmt = "%Y %b"
        elif spacing >= 3600 * 24:
            fmt = "%Y %b %d"
        elif spacing >= 3600:
            min_day = max_day = 1
            if len(values) > 0:
                min_day = datetime.fromtimestamp(
                    min(values), tz=timezone.utc).day
                max_day = datetime.fromtimestamp(
                    max(values), tz=timezone.utc).day
            if min_day == max_day:
                fmt = "%Hh"
            else:
                fmt = "%d %Hh"
        elif spacing >= 60:
            fmt = "%H:%M"
        elif spacing >= 1:
            fmt = "%H:%M:%S"
        else:
            fmt = '%S.%f'

        return [utc_from_timestamp(x).strftime(fmt) for x in values]
def tickStrings ( self , values , scale , spacing ) : if not self . _use_time : return super ( ) . tickStrings ( values , scale , spacing ) if spacing >= 3600 * 24 * 365 : fmt = "%Y" elif spacing >= 3600 * 24 * 28 : fmt = "%Y %b" elif spacing >= 3600 * 24 : fmt = "%Y %b %d" elif spacing >= 3600 : min_day = max_day = 1 if len ( values ) > 0 : min_day = datetime . fromtimestamp ( min ( values ) , tz = timezone . utc ) . day max_day = datetime . fromtimestamp ( max ( values ) , tz = timezone . utc ) . day if min_day == max_day : fmt = "%Hh" else : fmt = "%d %Hh" elif spacing >= 60 : fmt = "%H:%M" elif spacing >= 1 : fmt = "%H:%M:%S" else : fmt = '%S.%f' return [ utc_from_timestamp ( x ) . strftime ( fmt ) for x in values ]