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 6374f3a

Browse filesBrowse files
committed
Minor simplifications to scatter3d.
The lines ``` xs, ys, zs = np.broadcast_arrays( *[np.ravel(np.ma.filled(t, np.nan)) for t in [xs, ys, zs]]) ``` at the top of the function ensure that zs is already broadcasted against xs, and always 1D (and thus iterable); hence, the later iterability check and broadcasting are unnecessary.
1 parent c072f88 commit 6374f3a
Copy full SHA for 6374f3a

File tree

Expand file treeCollapse file tree

1 file changed

+1
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-5
lines changed

‎lib/mpl_toolkits/mplot3d/axes3d.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/mplot3d/axes3d.py
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,17 +2361,13 @@ def scatter(self, xs, ys, zs=0, zdir='z', s=20, c=None, depthshade=True,
23612361
xs, ys, zs, s, c = cbook.delete_masked_points(xs, ys, zs, s, c)
23622362

23632363
patches = super().scatter(xs, ys, s=s, c=c, *args, **kwargs)
2364-
is_2d = not np.iterable(zs)
2365-
zs = np.broadcast_to(zs, len(xs))
23662364
art3d.patch_collection_2d_to_3d(patches, zs=zs, zdir=zdir,
23672365
depthshade=depthshade)
23682366

23692367
if self._zmargin < 0.05 and xs.size > 0:
23702368
self.set_zmargin(0.05)
23712369

2372-
#FIXME: why is this necessary?
2373-
if not is_2d:
2374-
self.auto_scale_xyz(xs, ys, zs, had_data)
2370+
self.auto_scale_xyz(xs, ys, zs, had_data)
23752371

23762372
return patches
23772373

0 commit comments

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