()
| 26 | |
| 27 | |
| 28 | def test_repeated_save_with_alpha(): |
| 29 | # We want an image which has a background color of bluish green, with an |
| 30 | # alpha of 0.25. |
| 31 | |
| 32 | fig = Figure([1, 0.4]) |
| 33 | fig.set_facecolor((0, 1, 0.4)) |
| 34 | fig.patch.set_alpha(0.25) |
| 35 | |
| 36 | # The target color is fig.patch.get_facecolor() |
| 37 | |
| 38 | buf = io.BytesIO() |
| 39 | |
| 40 | fig.savefig(buf, |
| 41 | facecolor=fig.get_facecolor(), |
| 42 | edgecolor='none') |
| 43 | |
| 44 | # Save the figure again to check that the |
| 45 | # colors don't bleed from the previous renderer. |
| 46 | buf.seek(0) |
| 47 | fig.savefig(buf, |
| 48 | facecolor=fig.get_facecolor(), |
| 49 | edgecolor='none') |
| 50 | |
| 51 | # Check the first pixel has the desired color & alpha |
| 52 | # (approx: 0, 1.0, 0.4, 0.25) |
| 53 | buf.seek(0) |
| 54 | assert_array_almost_equal(tuple(imread(buf)[0, 0]), |
| 55 | (0.0, 1.0, 0.4, 0.250), |
| 56 | decimal=3) |
| 57 | |
| 58 | |
| 59 | def test_large_single_path_collection(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…