From e0c8d2930d46ed7626127cf99a6f812ffe413e76 Mon Sep 17 00:00:00 2001 From: Vince Knight Date: Sun, 12 Mar 2017 14:41:13 +0000 Subject: [PATCH] Add a test for correct placement of colorbar. --- axelrod/tests/unit/test_plot.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/axelrod/tests/unit/test_plot.py b/axelrod/tests/unit/test_plot.py index 2beda105a..0bd366707 100644 --- a/axelrod/tests/unit/test_plot.py +++ b/axelrod/tests/unit/test_plot.py @@ -257,6 +257,11 @@ def test_payoff_with_passed_axes(self): plot.payoff(ax=axarr[0, 1]) self.assertNotEqual(axarr[0, 1].get_xlim(), (0, 1)) + # Ensure color bar draw at same location as boxplot + color_bar_bbox = fig.axes[-1].get_position().get_points() + payoff_bbox_coord = fig.axes[1].get_position().get_points() + self.assertEqual(color_bar_bbox[1, 1], payoff_bbox_coord[1, 1], + msg="Color bar is not in correct location.") # Plot on another axes with a title plot.payoff(title="dummy title", ax=axarr[1, 0])