File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -777,7 +777,7 @@ def format_ticks(self, values):
777777 break
778778 elif level == 0 :
779779 # all tickdate are the same, so only micros might be different
780- # set to the most precise available (level= 6: microseconds doesn't exist...)
780+ # set to the most precise ( 6: microseconds doesn't exist...)
781781 level = 5
782782
783783 # level is the basic level we will label at.
Original file line number Diff line number Diff line change @@ -449,6 +449,14 @@ def _create_auto_date_locator(date1, date2):
449449 assert list (map (str , mdates .num2date (locator ()))) == expected
450450
451451
452+ def test_concise_formatter_subsecond ():
453+ locator = mdates .AutoDateLocator (interval_multiples = True )
454+ formatter = mdates .ConciseDateFormatter (locator )
455+ year_1996 = 9861.0
456+ strings = formatter .format_ticks ([year_1996 , year_1996 + 500 / mdates .MUSECONDS_PER_DAY , year_1996 + 900 / mdates .MUSECONDS_PER_DAY ])
457+ assert strings == ['00:00' , '00.0005' , '00.0009' ]
458+
459+
452460def test_concise_formatter ():
453461 def _create_auto_date_locator (date1 , date2 ):
454462 fig , ax = plt .subplots ()
You can’t perform that action at this time.
0 commit comments