| 286 | |
| 287 | |
| 288 | def test_subplot_change_projection(): |
| 289 | created_axes = set() |
| 290 | ax = plt.subplot() |
| 291 | created_axes.add(ax) |
| 292 | projections = ('aitoff', 'hammer', 'lambert', 'mollweide', |
| 293 | 'polar', 'rectilinear', '3d') |
| 294 | for proj in projections: |
| 295 | ax.remove() |
| 296 | ax = plt.subplot(projection=proj) |
| 297 | assert ax is plt.subplot() |
| 298 | assert ax.name == proj |
| 299 | created_axes.add(ax) |
| 300 | # Check that each call created a new Axes. |
| 301 | assert len(created_axes) == 1 + len(projections) |
| 302 | |
| 303 | |
| 304 | def test_polar_second_call(): |