|
9 | 9 |
|
10 | 10 | import matplotlib.widgets as widgets
|
11 | 11 | import matplotlib.pyplot as plt
|
12 |
| -from matplotlib.testing.decorators import cleanup |
| 12 | +from matplotlib.testing.decorators import cleanup, image_comparison |
13 | 13 |
|
14 | 14 | from numpy.testing import assert_allclose
|
15 | 15 |
|
@@ -271,3 +271,21 @@ def clicked_function():
|
271 | 271 | pass
|
272 | 272 | cid = check.on_clicked(clicked_function)
|
273 | 273 | check.disconnect(cid)
|
| 274 | + |
| 275 | + |
| 276 | +@image_comparison(baseline_images=['radio_buttons'], extensions=['png']) |
| 277 | +def test_radio_buttons_image(): |
| 278 | + ax = get_ax() |
| 279 | + plt.subplots_adjust(left=0.3) |
| 280 | + axcolor = 'lightgoldenrodyellow' |
| 281 | + rax = plt.axes([0.05, 0.7, 0.15, 0.15], facecolor=axcolor) |
| 282 | + widgets.RadioButtons(rax, ('Radio 1', 'Radio 2', 'Radio 3')) |
| 283 | + |
| 284 | + |
| 285 | +@image_comparison(baseline_images=['check_buttons'], extensions=['png']) |
| 286 | +def test_check_buttons_image(): |
| 287 | + ax = get_ax() |
| 288 | + plt.subplots_adjust(left=0.3) |
| 289 | + axcolor = 'lightgoldenrodyellow' |
| 290 | + rax = plt.axes([0.05, 0.7, 0.15, 0.15], facecolor=axcolor) |
| 291 | + widgets.CheckButtons(rax, ('Check 1', 'Check 2', 'Check 3'), (False, True, True)) |
0 commit comments