# HG changeset patch # User Daniel O'Connor # Date 1505119036 -34200 # Node ID 9fac3371e9ad51043c632c08a82b123574c771e1 # Parent 70cc1e8741572d2d8a929e4b57f7bfd0b6118af6 Print consumption and generation, tTwiddle text box, remove debugging. diff -r 70cc1e874157 -r 9fac3371e9ad agl.py --- a/agl.py Mon Sep 11 17:57:38 2017 +0930 +++ b/agl.py Mon Sep 11 18:07:16 2017 +0930 @@ -143,6 +143,8 @@ tarrifs = { 'power_exported' : 0.163, 'power_imported' : 0.380, + 'power_generated' : 0.163, + 'power_consumed' : 0.380, } names = { @@ -227,7 +229,6 @@ if col in tarrifs: annotation = '%s: $%.2f' % (names[col], (ydata[1:] * xdeltas).sum() / 1000.0 * tarrifs[col]) - print(annotation) else: annotation = None @@ -269,8 +270,9 @@ annotations.append(line[6]) ax2.legend(loc = 'upper right') - ax1.text(0.02, 0.8, reduce(lambda a, b: a + '\n' + b, annotations), - transform = ax1.transAxes, bbox=dict(facecolor='red', alpha=0.5)) + ax1.text(0.02, 0.9, reduce(lambda a, b: a + '\n' + b, annotations), + transform = ax1.transAxes, bbox = dict(facecolor = 'red', alpha = 0.5), + ha = 'left', va = 'top') ndays = int(max(1, round(((end - start).total_seconds()) / 86400))) for ax in fig.get_axes(): ax.set_title('%s to %s' % (start.strftime('%Y-%m-%d'), end.strftime('%Y-%m-%d')))