From 2db3ebcc48a23e969d65e82ad598d85e7776427a Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Thu, 12 Jan 2017 16:55:49 -1000 Subject: [PATCH] STY: fix poor date-time format defaults 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. --- lib/matplotlib/rcsetup.py | 6 +++--- matplotlibrc.template | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 20595ef5e581..762dcd6e4806 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -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], diff --git a/matplotlibrc.template b/matplotlibrc.template index df42caaf142d..f5dce983d9b5 100644 --- a/matplotlibrc.template +++ b/matplotlibrc.template @@ -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