Permalink
Browse files

Merge remote-tracking branch 'upstream/v1.2.x'

  • Loading branch information...
2 parents 23739dc + b9d3422 commit 1ccf29dad31efec5ddb6eacb391dcbdb1c74d556 @mdboom mdboom committed Apr 12, 2013
View
@@ -17,7 +17,7 @@ install:
- 'if [ $TRAVIS_PYTHON_VERSION == "3.2" ]; then pip install https://github.com/y-p/numpy/archive/1.6.2_with_travis_fix.tar.gz; fi'
- 'if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then pip install numpy; fi' # should be nop if pre-installed
- if [[ $TRAVIS_PYTHON_VERSION == '2.'* ]]; then pip install --use-mirrors PIL; fi
- - sudo apt-get install inkscape
+ - sudo apt-get update && sudo apt-get install inkscape
- python setup.py install
script:
View
@@ -122,6 +122,12 @@ The individual items of a collection may now have different alpha
values and be rendered correctly. This also fixes a bug where
collections were always filled in the PDF backend.
+Multiple images on same axes are correctly transparent
+------------------------------------------------------
+
+When putting multiple images onto the same axes, the background color
+of the axes will now show through correctly.
+
.. _whats-new-1-2:
new in matplotlib-1.2
View
@@ -315,7 +315,7 @@ def _draw_unsampled_image(self, renderer, gc):
fc = self.axes.patch.get_facecolor()
bg = mcolors.colorConverter.to_rgba(fc, 0)
- im.set_bg( *bg)
+ im.set_bg(*bg)
# image input dimensions
im.reset_matrix()
@@ -1078,7 +1078,7 @@ def get_window_extent(self, renderer=None):
def contains(self, mouseevent):
"""Test whether the mouse event occured within the image."""
- if callable(self._contains):
+ if callable(self._contains):
return self._contains(self, mouseevent)
if not self.get_visible():# or self.get_figure()._renderer is None:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -225,6 +225,15 @@ def test_image_edges():
assert g != 100, 'Expected a non-green edge - but sadly, it was.'
+@image_comparison(baseline_images=['image_composite_background'], remove_text=True)
+def test_image_composite_background():
+ fig = plt.figure()
+ ax = fig.add_subplot(111)
+ arr = np.arange(12).reshape(4, 3)
+ ax.imshow(arr, extent=[0, 2, 15, 0])
+ ax.imshow(arr, extent=[4, 6, 15, 0])
+ ax.set_axis_bgcolor((1, 0, 0, 0.5))
+ ax.set_xlim([0, 12])
if __name__=='__main__':
import nose
View
@@ -816,7 +816,7 @@ _image_module::from_images(const Py::Tuple& args)
pixfmt pixf(*imo->rbufOut);
renderer_base rb(pixf);
- rb.clear(agg::rgba(1, 1, 1, 1));
+ rb.clear(agg::rgba(0, 0, 0, 0));
for (size_t imnum = 0; imnum < N; imnum++)
{
tup = Py::Tuple(tups[imnum]);

0 comments on commit 1ccf29d

Please sign in to comment.