Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9827d1f

Browse filesBrowse files
committed
Consistent handling of empty composite images
1 parent 7f2f375 commit 9827d1f
Copy full SHA for 9827d1f

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎lib/matplotlib/image.py

Copy file name to clipboardExpand all lines: lib/matplotlib/image.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def composite_images(images, renderer, magnification=1.0):
102102
Bbox([[x, y], [x + data.shape[1], y + data.shape[0]]]))
103103

104104
if len(parts) == 0:
105-
return None, 0, 0
105+
return np.empty((0, 0, 4), dtype=np.uint8), 0, 0
106106

107107
bbox = Bbox.union(bboxes)
108108

@@ -149,7 +149,7 @@ def flush_images():
149149
elif len(image_group) > 1:
150150
data, l, b = composite_images(
151151
image_group, renderer, mag)
152-
if data is not None:
152+
if data.size != 0:
153153
gc = renderer.new_gc()
154154
gc.set_clip_rectangle(parent.bbox)
155155
gc.set_clip_path(parent.get_clip_path())

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.