Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitba0ea86

Browse files
authored
Merge pull request#13573 from jklymak/fix-mplot3d-transparency
Fix mplot3d transparency
2 parentsf8d02b9 +8b67728 commitba0ea86

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

‎lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ def set_alpha(self, alpha):
758758
raiseTypeError('alpha must be a float or None')
759759
artist.Artist.set_alpha(self,alpha)
760760
try:
761-
self._facecolors=mcolors.to_rgba_array(
761+
self._facecolors3d=mcolors.to_rgba_array(
762762
self._facecolors3d,self._alpha)
763763
except (AttributeError,TypeError,IndexError):
764764
pass

‎lib/mpl_toolkits/tests/test_mplot3d.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,24 @@ def test_poly_collection_2d_to_3d_empty():
454454
assertpoly.get_paths()== []
455455

456456

457+
@image_comparison(baseline_images=['poly3dcollection_alpha'],
458+
remove_text=True,extensions=['png'])
459+
deftest_poly3dcollection_alpha():
460+
fig=plt.figure()
461+
ax=fig.gca(projection='3d')
462+
463+
poly1=np.array([[0,0,1], [0,1,1], [0,0,0]],float)
464+
poly2=np.array([[0,1,1], [1,1,1], [1,1,0]],float)
465+
c1=art3d.Poly3DCollection([poly1],linewidths=3,edgecolor='k',
466+
facecolor=(0.5,0.5,1),closed=True)
467+
c1.set_alpha(0.5)
468+
c2=art3d.Poly3DCollection([poly2],linewidths=3,edgecolor='k',
469+
facecolor=(1,0.5,0.5),closed=False)
470+
c2.set_alpha(0.5)
471+
ax.add_collection3d(c1)
472+
ax.add_collection3d(c2)
473+
474+
457475
@image_comparison(baseline_images=['axes3d_labelpad'],extensions=['png'])
458476
deftest_axes3d_labelpad():
459477
frommatplotlibimportrcParams

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp