Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

TST: adding tests of current clear behavior on ticks#27457

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ksunden merged 3 commits intomatplotlib:mainfromtacaswell:tst/tick_clear_behavior
Mar 7, 2024
Merged
Changes fromall commits
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
43 changes: 43 additions & 0 deletionslib/matplotlib/tests/test_axes.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8898,3 +8898,46 @@ def test_axhvlinespan_interpolation():
ax.axhline(1, c="C0", alpha=.5)
ax.axhspan(.8, .9, fc="C1", alpha=.5)
ax.axhspan(.6, .7, .8, .9, fc="C2", alpha=.5)


@check_figures_equal(extensions=["png"])
@pytest.mark.parametrize("which", ("x", "y"))
def test_axes_clear_behavior(fig_ref, fig_test, which):
"""Test that the given tick params are not reset by ax.clear()."""
ax_test = fig_test.subplots()
ax_ref = fig_ref.subplots()
# the following tick params values are chosen to each create a visual difference
# from their defaults
target = {
"direction": "in",
"length": 10,
"width": 10,
"color": "xkcd:wine red",
"pad": 0,
"labelfontfamily": "serif",
"zorder": 7,
"labelrotation": 45,
"labelcolor": "xkcd:shocking pink",
# this overrides color + labelcolor, skip
# colors: ,
"grid_color": "xkcd:fluorescent green",
"grid_alpha": 0.5,
"grid_linewidth": 3,
"grid_linestyle": ":",
"bottom": False,
"top": True,
"left": False,
"right": True,
"labelbottom": True,
"labeltop": True,
"labelleft": True,
"labelright": True,
}

ax_ref.tick_params(axis=which, **target)

ax_test.tick_params(axis=which, **target)
ax_test.clear()

ax_ref.grid(True)
ax_test.grid(True)

[8]ページ先頭

©2009-2025 Movatter.jp