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