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

Skip to content

Commit 215f053

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

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8898,3 +8898,41 @@ 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",
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+
for ax in [ax_test, ax_ref]:
8935+
ax.tick_params(axis=which, **target)
8936+
8937+
ax_test.clear()
8938+
ax_test.tick_params(axis=which, **target)

0 commit comments

Comments
 (0)
0