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

Commit6b68d86

Browse files
authored
Merge pull request#13235 from anntzer/vectorize-zalpha
Vectorize mplot3d.art3d.zalpha.
2 parents121102b +3f59cde commit6b68d86

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -790,9 +790,9 @@ def zalpha(colors, zs):
790790
# in all three dimensions. Otherwise, at certain orientations,
791791
# the min and max zs are very close together.
792792
# Should really normalize against the viewing depth.
793-
colors=get_colors(colors,len(zs))
794-
iflen(zs):
795-
norm=Normalize(min(zs),max(zs))
796-
sats=1-norm(zs)*0.7
797-
colors= [(c[0],c[1],c[2],c[3]*s)forc,sinzip(colors,sats)]
798-
returncolors
793+
iflen(zs)==0:
794+
returnnp.zeros((0,4))
795+
norm=Normalize(min(zs),max(zs))
796+
sats=1-norm(zs)*0.7
797+
rgba=np.broadcast_to(mcolors.to_rgba_array(colors), (len(zs),4))
798+
returnnp.column_stack([rgba[:, :3],rgba[:,3]*sats])

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp