We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0303d0d commit 9efa68cCopy full SHA for 9efa68c
pandas/plotting/_converter.py
@@ -190,19 +190,20 @@ def __init__(self, locs):
190
self.locs = locs
191
192
def __call__(self, x, pos=0):
193
- fmt = '%H:%M:%S'
+ fmt = '%H:%M:%S.%f'
194
s = int(x)
195
ms = int((x - s) * 1e3)
196
- us = int((x - s) * 1e6 - ms)
+ us = int((x - s) * 1e6 - ms * 1e3)
197
+ msus = int((x - s) * 1e6)
198
m, s = divmod(s, 60)
199
h, m = divmod(m, 60)
200
_, h = divmod(h, 24)
201
if us != 0:
- fmt += '.%6f'
202
+ return pydt.time(h, m, s, msus).strftime(fmt)
203
elif ms != 0:
- fmt += '.%3f'
204
+ return pydt.time(h, m, s, msus).strftime(fmt)[:-3]
205
- return pydt.time(h, m, s, us).strftime(fmt)
206
+ return pydt.time(h, m, s).strftime('%H:%M:%S')
207
208
209
# Period Conversion
0 commit comments