Skip to content

add docstring for set_3d_properties for PatchCollection3d #19572

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
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
11 changes: 11 additions & 0 deletions lib/mpl_toolkits/mplot3d/art3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,17 @@ def set_sort_zpos(self, val):
self.stale = True

def set_3d_properties(self, zs, zdir):
"""
Update the z values of the offsets. If there are more XY points in
the offsets than there are Z points then points without a Z offset
will not be drawn.
Comment on lines +468 to +470
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Update the z values of the offsets. If there are more XY points in
the offsets than there are Z points then points without a Z offset
will not be drawn.
Update the offset values for the 3rd dimension. If there are more
XY points in the offsets than given here, these additional points
are not drawn.

Hope this makes it a little more clear. Z is a little ambiguous.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 that's definitely an improvement. My only question is what tense is the docstring speaking in? Since the draw will happen after this function is called I used will not be but are switches to the present tense which I found confusing. Not a big deal either way.


Parameters
----------
zs : array-like
The new z values for the offsets.
zdir : {'x', 'y', 'z'}
"""
# Force the collection to initialize the face and edgecolors
# just in case it is a scalarmappable with a colormap.
self.update_scalarmappable()
Expand Down