def __init__(self, *args, **kwargs): # the root class of AutoDateFormatter (TickHelper) is an old style # class prior to matplotlib version 1.2 if MATPLOTLIB_VERSION < [1, 2, 0]: AutoDateFormatter.__init__(self, *args, **kwargs) else: super(ObsPyAutoDateFormatter, self).__init__(*args, **kwargs) # Reset the scale to make it reproducible across matplotlib versions. self.scaled = {} self.scaled[1.0] = '%b %d %Y' self.scaled[30.0] = '%b %Y' self.scaled[365.0] = '%Y' self.scaled[1. / 24.] = FuncFormatter(format_hour_minute) self.scaled[1. / (24. * 60.)] = \ FuncFormatter(format_hour_minute_second) self.scaled[_seconds_to_days(1)] = \ FuncFormatter(format_hour_minute_second) self.scaled[_seconds_to_days(10)] = \ FuncFormatter(decimal_seconds_format_x_decimals(1)) # for some reason matplotlib is not using the following intermediate # decimal levels (probably some precision issue..) and falls back to # the lowest level immediately. self.scaled[_seconds_to_days(2e-1)] = \ FuncFormatter(decimal_seconds_format_x_decimals(2)) self.scaled[_seconds_to_days(2e-2)] = \ FuncFormatter(decimal_seconds_format_x_decimals(3)) self.scaled[_seconds_to_days(2e-3)] = \ FuncFormatter(decimal_seconds_format_x_decimals(4)) self.scaled[_seconds_to_days(2e-4)] = \ FuncFormatter(decimal_seconds_format_x_decimals(5))
def __init__(self, *args, **kwargs): # the root class of AutoDateFormatter (TickHelper) is an old style # class prior to matplotlib version 1.2 if MATPLOTLIB_VERSION < [1, 2, 0]: AutoDateFormatter.__init__(self, *args, **kwargs) else: super(ObsPyAutoDateFormatter, self).__init__(*args, **kwargs) # Reset the scale to make it reproducible across matplotlib versions. self.scaled = {} self.scaled[1.0] = '%b %d %Y' self.scaled[30.0] = '%b %Y' self.scaled[365.0] = '%Y' self.scaled[1. / 24.] = FuncFormatter(format_hour_minute) self.scaled[1. / (24. * 60.)] = \ FuncFormatter(format_hour_minute_second) self.scaled[_seconds_to_days(1)] = \ FuncFormatter(format_hour_minute_second) self.scaled[_seconds_to_days(10)] = \ FuncFormatter(decimal_seconds_format_x_decimals(1)) # for some reason matplotlib is not using the following intermediate # decimal levels (probably some precision issue..) and falls back to # the lowest level immediately. self.scaled[_seconds_to_days(2e-1)] = \ FuncFormatter(decimal_seconds_format_x_decimals(2)) self.scaled[_seconds_to_days(2e-2)] = \ FuncFormatter(decimal_seconds_format_x_decimals(3)) self.scaled[_seconds_to_days(2e-3)] = \ FuncFormatter(decimal_seconds_format_x_decimals(4)) self.scaled[_seconds_to_days(2e-4)] = \ FuncFormatter(decimal_seconds_format_x_decimals(5))
def __init__(self, locator, tz=None): """ Choose format prefix based on data range. Choose whether to include seconds based on unit. """ AutoDateFormatter.__init__(self, locator, tz) self.scaled = { 1./(24*60*60): '%H:%M:%S', 1. : '%H:%M', } self.prefixd = { 365. : '%Y %b %d ', 1. : '%b %d ', }
def __init__(self, *args, **kwargs): # the root class of AutoDateFormatter (TickHelper) is an old style # class prior to matplotlib version 1.2 if get_matplotlib_version() < [1, 2, 0]: AutoDateFormatter.__init__(self, *args, **kwargs) else: super(ObsPyAutoDateFormatter, self).__init__(*args, **kwargs) self.scaled[1. / 24.] = FuncFormatter(format_hour_minute) self.scaled[1. / (24. * 60.)] = \ FuncFormatter(format_hour_minute_second) self.scaled[_seconds_to_days(10)] = \ FuncFormatter(decimal_seconds_format_x_decimals(1)) # for some reason matplotlib is not using the following intermediate # decimal levels (probably some precision issue..) and falls back to # the lowest level immediately. self.scaled[_seconds_to_days(2e-1)] = \ FuncFormatter(decimal_seconds_format_x_decimals(2)) self.scaled[_seconds_to_days(2e-2)] = \ FuncFormatter(decimal_seconds_format_x_decimals(3)) self.scaled[_seconds_to_days(2e-3)] = \ FuncFormatter(decimal_seconds_format_x_decimals(4)) self.scaled[_seconds_to_days(2e-4)] = \ FuncFormatter(decimal_seconds_format_x_decimals(5))
def __init__(self, *args, **kwargs): # the root class of AutoDateFormatter (TickHelper) is an old style # class prior to matplotlib version 1.2 if get_matplotlib_version() < [1, 2, 0]: AutoDateFormatter.__init__(self, *args, **kwargs) else: super(ObsPyAutoDateFormatter, self).__init__(*args, **kwargs) self.scaled[1. / 24.] = FuncFormatter(format_hour_minute) self.scaled[1. / (24. * 60.)] = \ FuncFormatter(format_hour_minute_second) self.scaled[_seconds_to_days(10)] = \ FuncFormatter(decimal_seconds_format_x_decimals(1)) # for some reason matplotlib is not using the following intermediate # decimal levels (probably some precision issue..) and falls back to # the lowest level immediately. self.scaled[_seconds_to_days(2e-1)] = \ FuncFormatter(decimal_seconds_format_x_decimals(2)) self.scaled[_seconds_to_days(2e-2)] = \ FuncFormatter(decimal_seconds_format_x_decimals(3)) self.scaled[_seconds_to_days(2e-3)] = \ FuncFormatter(decimal_seconds_format_x_decimals(4)) self.scaled[_seconds_to_days(2e-4)] = \ FuncFormatter(decimal_seconds_format_x_decimals(5))
def __init__(self, locator): """Format dates according to the Phedex system""" tz = pytz.timezone("UTC") AutoDateFormatter.__init__(self, locator, tz=tz)
def __init__( self, locator ): tz = pytz.timezone( 'UTC' ) AutoDateFormatter.__init__( self, locator, tz = tz )
def __init__( self, locator ): tz = pytz.timezone( 'UTC' ) AutoDateFormatter.__init__( self, locator, tz = tz )