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

Update art3d.py to address strange behavior of depthshading on 3D scatterplots with close points#23085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
nhansendev wants to merge18 commits intomatplotlib:mainfromnhansendev:22861_bugfix
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
18 commits
Select commitHold shift + click to select a range
00d5d05
Update art3d.py
May 21, 2022
af2e2a2
Update art3d.py
May 21, 2022
1ed4648
Update art3d.py
May 21, 2022
ca24aae
Updated art3d.py per feedback
May 21, 2022
2ef7284
Update art3d.py
May 21, 2022
c085f47
Update art3d.py
May 21, 2022
6bb3cd5
Update art3d.py per reviewer feedback
Jun 1, 2022
2458402
Update art3d.py per reviewer feedback
Aug 22, 2022
bc4b40a
Merge branch 'matplotlib:main' into 22861_bugfix
nhansendevNov 29, 2023
52ad303
Improvements for depth-shading
nhansendevNov 29, 2023
968047b
Added kwargs for depth-shading
nhansendevNov 29, 2023
8657a07
Create depthshading_improvement.rst
nhansendevNov 29, 2023
b32d00b
Update depthshading_improvement.rst
nhansendevDec 17, 2023
ea4fff7
Merge branch 'main' into 22861_bugfix
nhansendevDec 17, 2023
25d0e22
Update art3d.py formatting
nhansendevDec 17, 2023
cfc05aa
Update axes3d.py formatting
nhansendevDec 17, 2023
dfb395c
Update depthshading_improvement.rst formatting
nhansendevDec 17, 2023
dc80ea0
Update depthshading_improvement.rst formatting
nhansendevDec 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletionsdoc/users/next_whats_new/depthshading_improvement.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
Depth-shading fix and more depth-shading options
--------------------------------------------------------------

New options have been added which allow users to modify the behavior of
depth-shading while addressing a visual bug.

Previously, a slightly buggy method of estimating the "depth" of plotted
items could lead to sudden and unexpected changes in transparency as the
plot orientation changed.

Now, the behavior has been made smooth and predictable, and the user is
provided with three new options: whether to invert the shading, setting the
lowest acceptable alpha value (highest transparency), and whether to use
the old algorithm.

The default behavior visually matches the old algorithm: items that appear to be
"deeper" into the screen will become increasingly transparent (up to the now
user-defined limit). If the inversion option is used then items will start
at maximum transparency and become gradually opaque with increasing depth.

Note 1: depth-shading applies to Patch3DCollections and Path3DCollections,
including scatter plots.

Note 2: "depthshade=True" must still be used to enable depth-shading

A simple example:

.. plot::
:include-source: true
:alt: A simple example showing different behavior of depthshading, which can be modified using the provided kwargs.

import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(projection="3d")

X = [i for i in range(10)]
Y = [i for i in range(10)]
Z = [i for i in range(10)]
S = [(i + 1) * 400 for i in range(10)]

ax.scatter(
xs=X,
ys=Y,
zs=Z,
s=S,
depthshade=True,
depthshade_minalpha=0.1,
depthshade_inverted=True,
depthshade_legacy=True,
)

plt.show()
Loading

[8]ページ先頭

©2009-2025 Movatter.jp