|
25 | 25 | from matplotlib.testing.noseclasses import KnownFailureTest
|
26 | 26 | import matplotlib.pyplot as plt
|
27 | 27 | import matplotlib.markers as mmarkers
|
| 28 | +import matplotlib.patches as mpatches |
28 | 29 | from numpy.testing import assert_allclose, assert_array_equal
|
29 | 30 | import warnings
|
30 | 31 | from matplotlib.cbook import IgnoredKeywordWarning
|
@@ -4417,6 +4418,27 @@ def test_date_timezone_x_and_y():
|
4417 | 4418 | plt.plot_date(time_index, time_index, tz='US/Eastern', ydate=True)
|
4418 | 4419 |
|
4419 | 4420 |
|
| 4421 | +@image_comparison(baseline_images=['axisbelow'], |
| 4422 | + extensions=['png'], remove_text=True) |
| 4423 | +def test_axisbelow(): |
| 4424 | + # Test 'line' setting added in 6287. |
| 4425 | + # Show only grids, not frame or ticks, to make this test |
| 4426 | + # independent of future change to drawing order of those elements. |
| 4427 | + fig, axs = plt.subplots(ncols=3, sharex=True, sharey=True) |
| 4428 | + settings = (False, 'line', True) |
| 4429 | + |
| 4430 | + for ax, setting in zip(axs, settings): |
| 4431 | + ax.plot((0, 10), (0, 10), lw=10, color='m') |
| 4432 | + circ = mpatches.Circle((3, 3), color='r') |
| 4433 | + ax.add_patch(circ) |
| 4434 | + ax.grid(color='c', linestyle='-', linewidth=3) |
| 4435 | + ax.tick_params(top=False, bottom=False, |
| 4436 | + left=False, right=False) |
| 4437 | + for spine in ax.spines.values(): |
| 4438 | + spine.set_visible(False) |
| 4439 | + ax.set_axisbelow(setting) |
| 4440 | + |
| 4441 | + |
4420 | 4442 | if __name__ == '__main__':
|
4421 | 4443 | import nose
|
4422 | 4444 | import sys
|
|
0 commit comments