Test automatic legend placement
()
| 67 | |
| 68 | @image_comparison(['legend_auto2.png'], remove_text=True, style='mpl20') |
| 69 | def test_legend_auto2(): |
| 70 | """Test automatic legend placement""" |
| 71 | fig, ax = plt.subplots() |
| 72 | x = np.arange(100) |
| 73 | b1 = ax.bar(x, x, align='edge', color='m') |
| 74 | b2 = ax.bar(x, x[::-1], align='edge', color='g') |
| 75 | ax.legend([b1[0], b2[0]], ['up', 'down'], loc='best') |
| 76 | |
| 77 | |
| 78 | @image_comparison(['legend_auto3.png'], style='mpl20') |