Skip to content

Commit 922c610

Browse files
willfurnasswesm
authored andcommitted
Override Matplotlib's Axes.format_coord method for tseries plots
1 parent 1569838 commit 922c610

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/tseries/plotting.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ def tsplot(series, plotf, **kwargs):
8282
left, right = _get_xlim(ax.get_lines())
8383
ax.set_xlim(left, right)
8484

85+
# x and y coord info
86+
tz = series.index.to_datetime().tz
87+
ax.format_coord = lambda t, y : "t = {} y = {:8f}".format(datetime.fromtimestamp(t, tz), y)
88+
8589
return lines
8690

8791

0 commit comments

Comments
 (0)