From 9d1395a2a0c731953438ddbcebfbcc86933645fe Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Tue, 2 Aug 2016 04:04:45 -0700 Subject: [PATCH] update 29 --- lib/bq.py | 2 +- lib/plot.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/bq.py b/lib/bq.py index 0595b74..ef29c69 100644 --- a/lib/bq.py +++ b/lib/bq.py @@ -24,7 +24,7 @@ HP2 = lambda A, Q: ((1, 0, 0), (1, 1/Q, 1)) PE2 = lambda A, Q: ((1, A/Q, 1), (1, 1/A/Q, 1)) -AP2 = lambda A, Q: ((1, 1/Q, 1), +AP2 = lambda A, Q: ((1, -1/Q, 1), (1, 1/Q, 1)) BP2a= lambda A, Q: ((0, -A/Q, 0), (1, 1/A/Q, 1)) diff --git a/lib/plot.py b/lib/plot.py index 711cc56..a26fc6a 100644 --- a/lib/plot.py +++ b/lib/plot.py @@ -46,7 +46,7 @@ def new_bode(magnitude_offset=0): response_setup(ax1, ymin, ymax) phase_response_setup(ax2) - cc = plt.style.library['ggplot']['axes.color_cycle'] + cc = plt.style.library['ggplot']['axes.prop_cycle'].by_key()['color'] ax1.set_ylabel(ax1.get_ylabel(), color=cc[0]) ax2.set_ylabel(ax2.get_ylabel(), color=cc[1]) for tl in ax1.get_yticklabels(): @@ -57,8 +57,8 @@ def new_bode(magnitude_offset=0): #ax1.hlines(0, 20, 40, linewidth=0.5, color=cc[0]) #ax2.hlines(0, 10000, 20000, linewidth=0.5, color=cc[1]) - # ax1 will use the initial color, so tell ax2 to iterate to the second - next(ax2._get_lines.color_cycle) + # share color cycles to prevent color re-use + ax2._get_lines.prop_cycler = ax1._get_lines.prop_cycler # ax1 and ax2 should have identical grids; # disable ax2's so it doesn't overlap ax1's plot lines.