Skip to content

Commit

Permalink
STY: fix poor date-time format defaults
Browse files Browse the repository at this point in the history
Without this change, zooming in from ticks separated by
days to ticks separated by multiples of hours leaves tick
labels with no date information, even when the time period
covers several days.

With the change there is a systematic progression from one
level to the next, dropping the largest unit and adding a
smaller unit.
  • Loading branch information
efiring committed Jan 13, 2017
1 parent 592e509 commit 2db3ebc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/matplotlib/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1135,10 +1135,10 @@ def validate_animation_writer_path(p):
'date.autoformatter.year': ['%Y', six.text_type],
'date.autoformatter.month': ['%Y-%m', six.text_type],
'date.autoformatter.day': ['%Y-%m-%d', six.text_type],
'date.autoformatter.hour': ['%H:%M', six.text_type],
'date.autoformatter.minute': ['%H:%M:%S', six.text_type],
'date.autoformatter.hour': ['%m-%d %H', six.text_type],
'date.autoformatter.minute': ['%d %H:%M', six.text_type],
'date.autoformatter.second': ['%H:%M:%S', six.text_type],
'date.autoformatter.microsecond': ['%H:%M:%S.%f', six.text_type],
'date.autoformatter.microsecond': ['%M:%S.%f', six.text_type],

#legend properties
'legend.fancybox': [True, validate_bool],
Expand Down
6 changes: 3 additions & 3 deletions matplotlibrc.template
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,10 @@ backend : $TEMPLATE_BACKEND
# date.autoformatter.year : %Y
# date.autoformatter.month : %Y-%m
# date.autoformatter.day : %Y-%m-%d
# date.autoformatter.hour : %H:%M
# date.autoformatter.minute : %H:%M:%S
# date.autoformatter.hour : %m-%d %H
# date.autoformatter.minute : %d %H:%M
# date.autoformatter.second : %H:%M:%S
# date.autoformatter.microsecond : %H:%M:%S.%f
# date.autoformatter.microsecond : %M:%S.%f

### TICKS
# see http://matplotlib.org/api/axis_api.html#matplotlib.axis.Tick
Expand Down

0 comments on commit 2db3ebc

Please sign in to comment.