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

Skip to content

Commit 69ec173

Browse files
committed
ENH: newdate formatter
1 parent a06d53a commit 69ec173

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/matplotlib/dates.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ def __init__(self, locator, tz=None, defaultfmt='%Y-%h-%d %H:%M:%S'):
792792
self._oldlabels = None
793793
self._formatter = DateFormatter(self.defaultfmt, tz)
794794
self._yearfmt = '%Y'
795-
self._monthfmt = '%h'
795+
self._monthfmt = '%b'
796796
self._dayfmt = '%d'
797797
self._hourfmt = '%H'
798798
self._minutefmt = '%M'
@@ -813,6 +813,7 @@ def __call__(self, x, pos=None):
813813

814814
for nn, tick in enumerate(ticks):
815815
tickdate += [num2date(tick)]
816+
print(tickdate)
816817
yearfmt = [self._yearfmt] * len(tickdate)
817818
monthfmt = [self._monthfmt] * len(tickdate)
818819
dayfmt = [self._dayfmt] * len(tickdate)
@@ -857,7 +858,7 @@ def __call__(self, x, pos=None):
857858
dayfmt[nn] = ''
858859
else:
859860
diffed = True
860-
if not diffed or tickdate[0].hour != 1:
861+
if not diffed or tickdate[0].hour != 0:
861862
dayfmt[0] = ''
862863
else:
863864
for nn in range(0, len(tickdate)):

0 commit comments

Comments
 (0)