|
35 | 35 | # the tests with multiple threads.
|
36 | 36 |
|
37 | 37 |
|
| 38 | +def test_get_labels(): |
| 39 | + fig, ax = plt.subplots() |
| 40 | + ax.set_xlabel('x label') |
| 41 | + ax.set_ylabel('y label') |
| 42 | + assert ax.get_xlabel() == 'x label' |
| 43 | + assert ax.get_ylabel() == 'y label' |
| 44 | + |
| 45 | + |
| 46 | +@image_comparison(baseline_images=['acorr'], extensions=['png'], style='mpl20') |
| 47 | +def test_acorr(): |
| 48 | + np.random.seed(19680801) |
| 49 | + n = 512 |
| 50 | + x = np.random.normal(0, 1, n).cumsum() |
| 51 | + |
| 52 | + fig, ax = plt.subplots() |
| 53 | + ax.acorr(x, maxlags=n - 1) |
| 54 | + |
| 55 | + |
| 56 | +@image_comparison(baseline_images=['spy'], extensions=['png'], style='mpl20') |
| 57 | +def test_spy(): |
| 58 | + np.random.seed(19680801) |
| 59 | + a = np.ones(32 * 32) |
| 60 | + a[:16 * 32] = 0 |
| 61 | + np.random.shuffle(a) |
| 62 | + a = np.reshape(a, (32, 32)) |
| 63 | + |
| 64 | + fig, ax = plt.subplots() |
| 65 | + ax.spy(a) |
| 66 | + |
| 67 | + |
| 68 | +@image_comparison(baseline_images=['matshow'], |
| 69 | + extensions=['png'], style='mpl20') |
| 70 | +def test_matshow(): |
| 71 | + np.random.seed(19680801) |
| 72 | + a = np.random.rand(32, 32) |
| 73 | + |
| 74 | + fig, ax = plt.subplots() |
| 75 | + ax.matshow(a) |
| 76 | + |
| 77 | + |
38 | 78 | @image_comparison(baseline_images=['formatter_ticker_001',
|
39 | 79 | 'formatter_ticker_002',
|
40 | 80 | 'formatter_ticker_003',
|
|
0 commit comments