Test expand mode
()
| 245 | |
| 246 | @image_comparison(['legend_expand.png'], remove_text=True, style='mpl20') |
| 247 | def test_legend_expand(): |
| 248 | """Test expand mode""" |
| 249 | legend_modes = [None, "expand"] |
| 250 | fig, axs = plt.subplots(len(legend_modes), 1) |
| 251 | x = np.arange(100) |
| 252 | for ax, mode in zip(axs, legend_modes): |
| 253 | ax.plot(x, 50 - x, 'o', label='y=1') |
| 254 | l1 = ax.legend(loc='upper left', mode=mode) |
| 255 | ax.add_artist(l1) |
| 256 | ax.plot(x, x - 50, 'o', label='y=-1') |
| 257 | l2 = ax.legend(loc='right', mode=mode) |
| 258 | ax.add_artist(l2) |
| 259 | ax.legend(loc='lower left', mode=mode, ncols=2) |
| 260 | |
| 261 | |
| 262 | @image_comparison(['hatching'], remove_text=True, style='default') |
nothing calls this directly
no test coverage detected
searching dependent graphs…