Skip to content
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

Fix issue with drawing 3D lines where points are from nparray #23563

Merged
merged 1 commit into from
Aug 19, 2022

Conversation

oscargus
Copy link
Member

@oscargus oscargus commented Aug 5, 2022

PR Summary

Closes #23459

The dimensions were different since get_xdata and get_ydata have processed the return values. So do a similar processing here.

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • [N/A] New features are documented, with examples if plot related.
  • [N/A] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • [N/A] Documentation is sphinx and numpydoc compliant (the docs should build without error).

@oscargus oscargus added this to the v3.6.0 milestone Aug 5, 2022
@QuLogic
Copy link
Member

QuLogic commented Aug 9, 2022

A far clearer test is:

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

ax.plot([[0], [1]], [[0], [1]], [[0], [1]])

which clearly shows that we seem to be downcasting 2D if its shape is (N, 1) to 1D with shape (N, ). I'm surprised that this works in 2D, but 2D plot accepts a bunch of weird things, so I guess we need to allow it in 3D.

@oscargus
Copy link
Member Author

oscargus commented Aug 9, 2022

Ahh, I didn't fully get the reason behind the error. Much clearer test suggested indeed.

@timhoffm timhoffm merged commit 04952fe into matplotlib:main Aug 19, 2022
@oscargus oscargus deleted the line3ddraw branch August 19, 2022 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: 'Line3D' object has no attribute '_verts3d'
3 participants