|
6 | 6 |
|
7 | 7 | import numpy |
8 | 8 | import matplotlib.pyplot as plt |
9 | | -from matplotlib.testing.decorators import image_comparison |
| 9 | +from matplotlib.testing.decorators import image_comparison, cleanup |
10 | 10 |
|
11 | 11 | from nose.tools import assert_raises |
12 | 12 |
|
@@ -105,19 +105,22 @@ def test_exceptions(): |
105 | 105 | # TODO should this test more options? |
106 | 106 | assert_raises(ValueError, plt.subplots, 2, 2, sharex='blah') |
107 | 107 | assert_raises(ValueError, plt.subplots, 2, 2, sharey='blah') |
| 108 | + assert_raises(ValueError, plt.subplots, 2, 2, 0) |
| 109 | + assert_raises(ValueError, plt.subplots, 2, 2, 5) |
108 | 110 |
|
109 | 111 |
|
110 | 112 | @image_comparison(baseline_images=['subplots_offset_text'], remove_text=False) |
111 | 113 | def test_subplots_offsettext(): |
112 | | - x = numpy.arange(0,1e10,1e9) |
113 | | - y = numpy.arange(0,100,10)+1e4 |
114 | | - fig,axes = plt.subplots(2,2, sharex = 'col', sharey = 'all') |
115 | | - axes[0,0].plot(x,x) |
116 | | - axes[1,0].plot(x,x) |
117 | | - axes[0,1].plot(y,x) |
118 | | - axes[1,1].plot(y,x) |
| 114 | + x = numpy.arange(0, 1e10, 1e9) |
| 115 | + y = numpy.arange(0, 100, 10)+1e4 |
| 116 | + fig, axes = plt.subplots(2, 2, sharex='col', sharey='all') |
| 117 | + axes[0, 0].plot(x, x) |
| 118 | + axes[1, 0].plot(x, x) |
| 119 | + axes[0, 1].plot(y, x) |
| 120 | + axes[1, 1].plot(y, x) |
119 | 121 |
|
120 | 122 |
|
| 123 | +@cleanup |
121 | 124 | def test_subplots(): |
122 | 125 | # things to test |
123 | 126 | # - are axes actually shared? |
|
0 commit comments