Skip to content

Commit

Permalink
Add a test for correct placement of colorbar.
Browse files Browse the repository at this point in the history
  • Loading branch information
drvinceknight committed Mar 12, 2017
1 parent a814297 commit e0c8d29
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions axelrod/tests/unit/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit e0c8d29

Please sign in to comment.