# HG changeset patch # User Daniel O'Connor # Date 1505095372 -34200 # Node ID 525a66486282c7f3aa07158bfd59e7b078e026a2 # Parent 2b7fb26f9114e623e1fe77644843ae1b87b3f43d Fix mouse hover formatting. diff -r 2b7fb26f9114 -r 525a66486282 agl.py --- a/agl.py Mon Sep 11 10:28:05 2017 +0930 +++ b/agl.py Mon Sep 11 11:32:52 2017 +0930 @@ -225,6 +225,7 @@ ndays = int(max(1, round(((end - start).total_seconds()) / 86400))) for ax in fig.get_axes(): ax.set_xlim([start, end]) + ax.format_xdata = lambda d: matplotlib.dates.num2date(d).strftime('%d %b %H:%M') ax.xaxis.grid(True) ax.xaxis.set_major_formatter(matplotlib.dates.DateFormatter('%d %b\n%H:%M')) ax.xaxis.set_major_locator(matplotlib.dates.HourLocator(interval = 2 * ndays))