8000 TST: adding tests of current clear behavior on ticks · matplotlib/matplotlib@dd19976 · GitHub
[go: up one dir, main page]

Skip to content

Commit dd19976

Browse files
committed
TST: adding tests of current clear behavior on ticks
closes #23839
1 parent 5b5154d commit dd19976

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8898,3 +8898,43 @@ def test_axhvlinespan_interpolation():
88988898
ax.axhline(1, c="C0", alpha=.5)
88998899
ax.axhspan(.8, .9, fc="C1", alpha=.5)
89008900
ax.axhspan(.6, .7, .8, .9, fc="C2", alpha=.5)
8901+
8902+
8903+
@check_figures_equal(extensions=["png"])
8904+
@pytest.mark.parametrize("which", ("x", "y"))
8905+
def test_axes_clear_behavior(fig_ref, fig_test, which):
8906+
ax_test = fig_test.subplots()
8907+
ax_ref = fig_ref.subplots()
8908+
target = {
8909+
"direction": "in",
< 10000 div aria-hidden="true" class="position-absolute top-0 d-flex user-select-none DiffLineTableCellParts-module__comment-indicator--eI0hb">
8910+
"length": 10,
8911+
"width": 10,
8912+
"color": "xkcd:wine red",
8913+
"pad": 0,
8914+
"labelfontfamily": "serif",
8915+
"zorder": 7,
8916+
"labelrotation": 45,
8917+
"labelcolor": "xkcd:shocking pink",
8918+
# this overrides color + labelcolor, skip
8919+
# colors: ,
8920+
"grid_color": "xkcd:fluorescent green",
8921+
"grid_alpha": 0.5,
8922+
"grid_linewidth": 3,
8923+
"grid_linestyle": ":",
8924+
"bottom": False,
8925+
"top": True,
8926+
"left": False,
8927+
"right": True,
8928+
"labelbottom": True,
8929+
"labeltop": True,
8930+
"labelleft": True,
8931+
"labelright": True,
8932+
}
8933+
8934+
ax_ref.tick_params(axis=which, **target)
8935+
8936+
ax_test.tick_params(axis=which, **target)
8937+
ax_test.clear()
8938+
8939+
ax_ref.grid(True)
8940+
ax_test.grid(True)

0 commit comments

Comments
 (0)
0