Skip to content

Commit c8d02a4

Browse files
committed
Fix matplotlib#3057: Don't composite when interpolation == 'none'
1 parent fcd2b71 commit c8d02a4

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎lib/matplotlib/axes/_base.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2319,7 +2319,9 @@ def draw(self, renderer=None, inframe=False):
23192319

23202320
# add images to dsu if the backend supports compositing.
23212321
# otherwise, does the manual compositing without adding images to dsu.
2322-
if len(self.images) <= 1 or renderer.option_image_nocomposite():
2322+
if (len(self.images) <= 1 or
2323+
renderer.option_image_nocomposite() or
2324+
any(im.get_interpolation() == 'none' for im in self.images)):
23232325
_do_composite = False
23242326
else:
23252327
_do_composite = True

‎lib/matplotlib/figure.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,7 @@ def draw(self, renderer):
12481248
not_composite = self.suppressComposite
12491249

12501250
if (len(self.images) <= 1 or not_composite or
1251-
not cbook.allequal([im.origin for im in self.images])):
1251+
any(im.get_interpolation() == 'none' for im in self.images)):
12521252
for a in self.images:
12531253
dsu.append((a.get_zorder(), a, a.draw, [renderer]))
12541254
else:

0 commit comments

Comments
 (0)