Skip to content

ENH: add axisbelow option 'line', make it the default #6287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 2, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add image test for the 3 axisbelow options
  • Loading branch information
efiring committed May 1, 2016
commit efffe26a76351be2aa6a869e80d683908a68408e
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from matplotlib.testing.noseclasses import KnownFailureTest
import matplotlib.pyplot as plt
import matplotlib.markers as mmarkers
import matplotlib.patches as mpatches
from numpy.testing import assert_allclose, assert_array_equal
import warnings
from matplotlib.cbook import IgnoredKeywordWarning
Expand Down Expand Up @@ -4417,6 +4418,27 @@ def test_date_timezone_x_and_y():
plt.plot_date(time_index, time_index, tz='US/Eastern', ydate=True)


@image_comparison(baseline_images=['axisbelow'],
extensions=['png'], remove_text=True)
def test_axisbelow():
# Test 'line' setting added in 6287.
# Show only grids, not frame or ticks, to make this test
# independent of future change to drawing order of those elements.
fig, axs = plt.subplots(ncols=3, sharex=True, sharey=True)
settings = (False, 'line', True)

for ax, setting in zip(axs, settings):
ax.plot((0, 10), (0, 10), lw=10, color='m')
circ = mpatches.Circle((3, 3), color='r')
ax.add_patch(circ)
ax.grid(color='c', linestyle='-', linewidth=3)
ax.tick_params(top=False, bottom=False,
left=False, right=False)
for spine in ax.spines.values():
spine.set_visible(False)
ax.set_axisbelow(setting)


if __name__ == '__main__':
import nose
import sys
Expand Down