Skip to content

Commit 08734c8

Browse files
committed
Add a test for correct placement of colorbar.
1 parent cb738f0 commit 08734c8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

axelrod/tests/unit/test_plot.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,11 @@ def test_payoff_with_passed_axes(self):
257257

258258
plot.payoff(ax=axarr[0, 1])
259259
self.assertNotEqual(axarr[0, 1].get_xlim(), (0, 1))
260+
# Ensure color bar draw at same location as boxplot
261+
color_bar_bbox = fig.axes[-1].get_position().get_points()
262+
payoff_bbox_coord = fig.axes[1].get_position().get_points()
263+
self.assertEqual(color_bar_bbox[1, 1], payoff_bbox_coord[1, 1],
264+
msg="Color bar is not in correct location.")
260265

261266
# Plot on another axes with a title
262267
plot.payoff(title="dummy title", ax=axarr[1, 0])

0 commit comments

Comments
 (0)