8000 Add new test to check for square check buttons · matplotlib/matplotlib@31e9a1f · GitHub
[go: up one dir, main page]

Skip to content

Commit 31e9a1f

Browse files
committed
Add new test to check for square check buttons
1 parent a1ce87b commit 31e9a1f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/matplotlib/tests/test_widgets.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,18 @@ def test_radio_buttons(fig_test, fig_ref):
10241024
ax.text(.25, 1/3, "coffee", transform=ax.transAxes, va="center")
10251025

10261026

1027+
@check_figures_equal(extensions=["png"])
1028+
def test_check_buttons(fig_test, fig_ref):
1029+
widgets.CheckButtons(fig_test.subplots(), ["tea", "coffee"], [True, True])
1030+
ax = fig_ref.add_subplot(xticks=[], yticks=[])
1031+
ax.scatter([.15, .15], [2/3, 1/3], marker='s', transform=ax.transAxes,
1032+
s=(plt.rcParams["font.size"] / 2) ** 2, c=["none", "none"])
1033+
ax.scatter([.15, .15], [2/3, 1/3], marker='x', transform=ax.transAxes,
1034+
s=(plt.rcParams["font.size"] / 2) ** 2, c=["k", "k"])
1035+
ax.text(.25, 2/3, "tea", transform=ax.transAxes, va="center")
1036+
ax.text(.25, 1/3, "coffee", transform=ax.transAxes, va="center")
1037+
1038+
10271039
def test_slider_slidermin_slidermax_invalid():
10281040
fig, ax = plt.subplots()
10291041
# test min/max with floats

0 commit comments

Comments
 (0)
0