示例#1
0
文件: util.py 项目: junlysky/obspy
 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))
示例#2
0
文件: util.py 项目: zurgeg/obspy
 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))
示例#3
0
 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 ',
     }
示例#4
0
 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))
示例#5
0
文件: util.py 项目: 3rdcycle/obspy
 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))
示例#6
0
 def __init__(self, locator):
     """Format dates according to the Phedex system"""
     tz = pytz.timezone("UTC")
     AutoDateFormatter.__init__(self, locator, tz=tz)
示例#7
0
 def __init__( self, locator ):
   tz = pytz.timezone( 'UTC' )
   AutoDateFormatter.__init__( self, locator, tz = tz )
示例#8
0
 def __init__( self, locator ):
   tz = pytz.timezone( 'UTC' )
   AutoDateFormatter.__init__( self, locator, tz = tz )