diff --git a/lib/matplotlib/tests/baseline_images/test_image/image_alpha.pdf b/lib/matplotlib/tests/baseline_images/test_image/image_alpha.pdf index a3d519b1807..98060d69250 100644 Binary files a/lib/matplotlib/tests/baseline_images/test_image/image_alpha.pdf and b/lib/matplotlib/tests/baseline_images/test_image/image_alpha.pdf differ diff --git a/lib/matplotlib/tests/baseline_images/test_image/image_alpha.png b/lib/matplotlib/tests/baseline_images/test_image/image_alpha.png index 5273e353a38..7a9281f6ab6 100644 Binary files a/lib/matplotlib/tests/baseline_images/test_image/image_alpha.png and b/lib/matplotlib/tests/baseline_images/test_image/image_alpha.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_image/image_alpha.svg b/lib/matplotlib/tests/baseline_images/test_image/image_alpha.svg index 5da300886fc..a46daa66e4c 100644 --- a/lib/matplotlib/tests/baseline_images/test_image/image_alpha.svg +++ b/lib/matplotlib/tests/baseline_images/test_image/image_alpha.svg @@ -19,35 +19,35 @@ z - - - + - - - - @@ -56,80 +56,80 @@ L 274.909091 114.545455 +" id="m4c2f53e4f5" style="stroke:#000000;stroke-width:0.5;"/> - + +" id="mfae2baf830" style="stroke:#000000;stroke-width:0.5;"/> - + - + - + - + - + - + - + - + - + - + - + @@ -140,80 +140,80 @@ L 0 4 +" id="mf3812b7f6d" style="stroke:#000000;stroke-width:0.5;"/> - + +" id="m90d84cb068" style="stroke:#000000;stroke-width:0.5;"/> - + - + - + - + - + - + - + - + - + - + - + @@ -221,107 +221,107 @@ L -4 0 - - - + + - - - - - + - + - + - + - + - + - + - + - + - + - + - + @@ -330,72 +330,254 @@ L 518.4 114.545455 - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -403,11 +585,14 @@ L 518.4 114.545455 - - + + + + + - - + + diff --git a/lib/matplotlib/tests/baseline_images/test_image/image_composite_alpha.png b/lib/matplotlib/tests/baseline_images/test_image/image_composite_alpha.png index 95e943657a8..ba2a4b31e8f 100644 Binary files a/lib/matplotlib/tests/baseline_images/test_image/image_composite_alpha.png and b/lib/matplotlib/tests/baseline_images/test_image/image_composite_alpha.png differ diff --git a/lib/matplotlib/tests/test_image.py b/lib/matplotlib/tests/test_image.py index ef64e9c0107..8ef34790b3c 100644 --- a/lib/matplotlib/tests/test_image.py +++ b/lib/matplotlib/tests/test_image.py @@ -176,10 +176,13 @@ def test_image_alpha(): np.random.seed(0) Z = np.random.rand(6, 6) - plt.subplot(121) + plt.subplot(131) + plt.imshow(Z, alpha=1.0, interpolation='none') + + plt.subplot(132) plt.imshow(Z, alpha=0.5, interpolation='none') - plt.subplot(122) + plt.subplot(133) plt.imshow(Z, alpha=0.5, interpolation='nearest') @cleanup diff --git a/src/_backend_agg_wrapper.cpp b/src/_backend_agg_wrapper.cpp index d1003194cbe..494f7316f4b 100644 --- a/src/_backend_agg_wrapper.cpp +++ b/src/_backend_agg_wrapper.cpp @@ -299,6 +299,7 @@ static PyObject *PyRendererAgg_draw_image(PyRendererAgg *self, PyObject *args, P x = mpl_round(x); y = mpl_round(y); + gc.alpha = 1.0; CALL_CPP("draw_image", (self->x->draw_image(gc, x, y, image))); Py_RETURN_NONE;