()
| 855 | |
| 856 | |
| 857 | def test_axes_removal(): |
| 858 | # Check that units can set the formatter after an Axes removal |
| 859 | fig, axs = plt.subplots(1, 2, sharex=True) |
| 860 | axs[1].remove() |
| 861 | axs[0].plot([datetime(2000, 1, 1), datetime(2000, 2, 1)], [0, 1]) |
| 862 | assert isinstance(axs[0].xaxis.get_major_formatter(), |
| 863 | mdates.AutoDateFormatter) |
| 864 | |
| 865 | # Check that manually setting the formatter, then removing Axes keeps |
| 866 | # the set formatter. |
| 867 | fig, axs = plt.subplots(1, 2, sharex=True) |
| 868 | axs[1].xaxis.set_major_formatter(ScalarFormatter()) |
| 869 | axs[1].remove() |
| 870 | axs[0].plot([datetime(2000, 1, 1), datetime(2000, 2, 1)], [0, 1]) |
| 871 | assert isinstance(axs[0].xaxis.get_major_formatter(), |
| 872 | ScalarFormatter) |
| 873 | |
| 874 | |
| 875 | def test_removed_axis(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…