Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4876bb5

Browse files
authored
Fix ConciseDateFormatter when only micros change
When micros only are changing (we are zoomed inside a second), the formatter previously computed a level 0 : year, displaying only years... when microseconds were expected.
1 parent 31a034b commit 4876bb5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/matplotlib/dates.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,10 @@ def format_ticks(self, values):
775775
for level in range(5, -1, -1):
776776
if len(np.unique(tickdate[:, level])) > 1:
777777
break
778+
elif level == 0:
779+
# all tickdate are the same, so only micros might be different
780+
# set to the most precise available (level=6: microseconds doesn't exist...)
781+
level = 5
778782

779783
# level is the basic level we will label at.
780784
# now loop through and decide the actual ticklabels

0 commit comments

Comments
 (0)