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 a615aed

Browse filesBrowse files
committed
Add setters for more overridden 3D collection properties.
1 parent 60c4f70 commit a615aed
Copy full SHA for a615aed

File tree

2 files changed

+13
-3
lines changed
Filter options

2 files changed

+13
-3
lines changed

‎lib/mpl_toolkits/mplot3d/art3d.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/mplot3d/art3d.py
+10-2Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,14 @@ def set_edgecolor(self, c):
507507
super().set_edgecolor(c)
508508
self._edgecolor3d = self.get_edgecolor()
509509

510+
def set_sizes(self, sizes, dpi=72.0):
511+
super().set_sizes(sizes, dpi=dpi)
512+
self._sizes3d = self.get_sizes()
513+
514+
def set_linewidth(self, lw):
515+
super().set_linewidth(lw)
516+
self._linewidth3d = self.get_linewidth()
517+
510518
def do_3d_projection(self, renderer):
511519
xs, ys, zs = self._offsets3d
512520
vxs, vys, vzs, vis = proj3d.proj_transform_clip(xs, ys, zs, renderer.M)
@@ -542,8 +550,8 @@ def do_3d_projection(self, renderer):
542550

543551
super().set_edgecolor(ecs)
544552
super().set_facecolor(fcs)
545-
self.set_sizes(sizes)
546-
self.set_linewidth(lws)
553+
super().set_sizes(sizes)
554+
super().set_linewidth(lws)
547555

548556
PathCollection.set_offsets(self, vps)
549557

‎lib/mpl_toolkits/tests/test_mplot3d.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/tests/test_mplot3d.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,12 @@ def test_scatter3d_modification(fig_ref, fig_test):
251251
marker='o')
252252
c.set_facecolor('C1')
253253
c.set_edgecolor('C2')
254+
c.set_sizes(np.full(10, 75))
255+
c.set_linewidths(3)
254256

255257
ax_ref = fig_ref.add_subplot(projection='3d')
256258
ax_ref.scatter(np.arange(10), np.arange(10), np.arange(10), marker='o',
257-
facecolor='C1', edgecolor='C2')
259+
facecolor='C1', edgecolor='C2', s=75, linewidths=3)
258260

259261

260262
@pytest.mark.parametrize('depthshade', [True, False])

0 commit comments

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