| 67 | |
| 68 | |
| 69 | class MyFormatter(Formatter): |
| 70 | def __init__(self, dates, fmt='%a'): |
| 71 | self.dates = dates |
| 72 | self.fmt = fmt |
| 73 | |
| 74 | def __call__(self, x, pos=0): |
| 75 | """Return the label for time x at position pos.""" |
| 76 | try: |
| 77 | return self.dates[round(x)].item().strftime(self.fmt) |
| 78 | except IndexError: |
| 79 | pass |
| 80 | |
| 81 | |
| 82 | ax2.xaxis.set_major_formatter(MyFormatter(r["date"], '%a')) |
no outgoing calls
no test coverage detected
searching dependent graphs…