Skip to content

Commit

Permalink
Override Matplotlib's Axes.format_coord method for tseries plots
Browse files Browse the repository at this point in the history
  • Loading branch information
willfurnass authored and wesm committed Apr 9, 2013
1 parent 1569838 commit 922c610
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pandas/tseries/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ def tsplot(series, plotf, **kwargs):
left, right = _get_xlim(ax.get_lines())
ax.set_xlim(left, right)

# x and y coord info
tz = series.index.to_datetime().tz
ax.format_coord = lambda t, y : "t = {} y = {:8f}".format(datetime.fromtimestamp(t, tz), y)

return lines


Expand Down

0 comments on commit 922c610

Please sign in to comment.