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

Skip to content

Commit 708d945

Browse files
tacaswellImpaler343
authored andcommitted
TST: adding tests of current clear behavior on ticks
closes matplotlib#23839
1 parent e0b8afa commit 708d945

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
@@ -8920,3 +8920,43 @@ def test_axhvlinespan_interpolation():
89208920
ax.axhline(1, c="C0", alpha=.5)
89218921
ax.axhspan(.8, .9, fc="C1", alpha=.5)
89228922
ax.axhspan(.6, .7, .8, .9, fc="C2", alpha=.5)
8923+
8924+
8925+
@check_figures_equal(extensions=["png"])
8926+
@pytest.mark.parametrize("which", ("x", "y"))
8927+
def test_axes_clear_behavior(fig_ref, fig_test, which):
8928+
ax_test = fig_test.subplots()
8929+
ax_ref = fig_ref.subplots()
8930+
target = {
8931+
"direction": "in",
8932+
"length": 10,
8933+
"width": 10,
8934+
"color": "xkcd:wine red",
8935+
"pad": 0,
8936+
"labelfontfamily": "serif",
8937+
"zorder": 7,
8938+
"labelrotation": 45,
8939+
"labelcolor": "xkcd:shocking pink",
8940+
# this overrides color + labelcolor, skip
8941+
# colors: ,
8942+
"grid_color": "xkcd:fluorescent green",
8943+
"grid_alpha": 0.5,
8944+
"grid_linewidth": 3,
8945+
"grid_linestyle": ":",
8946+
"bottom": False,
8947+
"top": True,
8948+
"left": False,
8949+
"right": True,
8950+
"labelbottom": True,
8951+
"labeltop": True,
8952+
"labelleft": True,
8953+
"labelright": True,
8954+
}
8955+
8956+
ax_ref.tick_params(axis=which, **target)
8957+
8958+
ax_test.tick_params(axis=which, **target)
8959+
ax_test.clear()
8960+
8961+
ax_ref.grid(True)
8962+
ax_test.grid(True)

0 commit comments

Comments
 (0)
0