Skip to content

Commit 0076141

Browse files
committed
Fix array-like linewidth for 3d scatter
1 parent 37ccdca commit 0076141

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ def do_3d_projection(self):
600600
self._sizes = self._sizes3d[z_markers_idx]
601601

602602
if len(self._linewidths3d) > 1:
603-
self._linewidths = self._linewidths3d[z_markers_idx]
603+
self._linewidths = np.array(self._linewidths3d)[z_markers_idx]
604604

605605
# Re-order items
606606
vzs = vzs[z_markers_idx]
44.9 KB
Loading

lib/mpl_toolkits/tests/test_mplot3d.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,16 @@ def test_scatter3d_color():
299299
color='b', marker='s')
300300

301301

302+
@mpl3d_image_comparison(['scatter3d_linewidth.png'])
303+
def test_scatter3d_linewidth():
304+
fig = plt.figure()
305+
ax = fig.add_subplot(projection='3d')
306+
307+
# Check that array-like linewidth can be set
308+
ax.scatter(np.arange(10), np.arange(10), np.arange(10),
309+
marker='o', linewidth=np.arange(10))
310+
311+
302312
@check_figures_equal(extensions=['png'])
303313
def test_scatter3d_modification(fig_ref, fig_test):
304314
# Changing Path3DCollection properties post-creation should work correctly.

0 commit comments

Comments
 (0)