Skip to content

Commit e904b90

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

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
@@ -2318,7 +2318,9 @@ def draw(self, renderer=None, inframe=False):
23182318

23192319
# add images to dsu if the backend supports compositing.
23202320
# otherwise, does the manual compositing without adding images to dsu.
2321-
if len(self.images) <= 1 or renderer.option_image_nocomposite():
2321+
if (len(self.images) <= 1 or
2322+
renderer.option_image_nocomposite() or
2323+
any(im.get_interpolation() == 'none' for im in self.images)):
23222324
_do_composite = False
23232325
else:
23242326
_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)