Skip to content

Commit e934dd0

Browse files
committed
Fix image clipping to a path and add a test.
svn path=/branches/v1_0_maint/; revision=8570
1 parent c47af12 commit e934dd0

File tree

6 files changed

+676
-1
lines changed

6 files changed

+676
-1
lines changed

lib/matplotlib/axes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6732,7 +6732,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
67326732
im.set_data(X)
67336733
im.set_alpha(alpha)
67346734
self._set_artist_props(im)
6735-
if not im.get_clip_on():
6735+
if im.get_clip_path() is None:
67366736
# image does not already have clipping set, clip to axes patch
67376737
im.set_clip_path(self.patch)
67386738
#if norm is None and shape is None:

lib/matplotlib/image.py

+3
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ def draw(self, renderer, *args, **kwargs):
338338
gc = renderer.new_gc()
339339
gc.set_clip_rectangle(self.axes.bbox.frozen())
340340
gc.set_clip_path(self.get_clip_path())
341+
print self.get_clip_path()
341342

342343
if self._check_unsampled_image(renderer):
343344
self._draw_unsampled_image(renderer, gc)
@@ -541,6 +542,8 @@ def __init__(self, ax,
541542
**kwargs
542543
)
543544

545+
print "__init__", self.get_clip_on()
546+
544547

545548
def make_image(self, magnification=1.0):
546549
if self._A is None:
Binary file not shown.

0 commit comments

Comments
 (0)