Created
April 26, 2015 21:08
-
-
Save avasilkov/eac0361250937923dce4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def xtick_formatter(x, fmt, td, p): | |
| res = None | |
| if x < p[-1][0]: | |
| res = (p[-1][1] + (x - p[-1][0]) * td).strftime(fmt) | |
| else: | |
| #it's reversed | |
| for i in p: | |
| if i[0] <= x: | |
| res = (i[1] + (x - i[0]) * td).strftime(fmt) | |
| break | |
| return res |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment