Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Sort 3d sizes along with other properties #18136

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

Merged
merged 1 commit into from
Aug 2, 2020
Merged

Sort 3d sizes along with other properties #18136

merged 1 commit into from
Aug 2, 2020

Conversation

tomneep
Copy link
Contributor

@tomneep tomneep commented Jul 31, 2020

PR Summary

Fixes #18135. The sizes of the points need to be updated when reordering along with the other properties.

scatter3d_fixed

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • [n/a] New features are documented, with examples if plot related
  • [n/a] Documentation is sphinx and numpydoc compliant
  • [n/a] Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • [n/a] Documented in doc/api/next_api_changes/* if API changed in a backward-incompatible way

@WeatherGod
Copy link
Member

This seems to be the right solution, but this is going to need a test. You can use the demo code in the original issue as the basis for the test.

@timhoffm timhoffm added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Jul 31, 2020
@timhoffm timhoffm added this to the v3.3.1 milestone Jul 31, 2020
@timhoffm
Copy link
Member

Targeting for 3.3.1 as release critical, because it's a regression in 3.3.0 introduced via #17378.

@tomneep
Copy link
Contributor Author

tomneep commented Jul 31, 2020

Added a test. Maybe plotting 100 points was overkill thinking about it. Let me know if you want me to reduce the number of points.

Pre-fix

old

Post-fix

new

Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

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

Maybe plotting 100 points was overkill thinking about it. Let me know if you want me to reduce the number of points.

That does not affect the drawing time significantly, so IMHO it's ok.

@WeatherGod
Copy link
Member

This looks pretty good. Quick question for the peanut gallery. Technically speaking, a Poly3DCollection is probably also impacted by this bug because it derives from PolyCollection, which derives from _CollectionWithSizes. Don't know of any real use-case though of specifying sizes for poly3d collections, though (or if it even works?).

@QuLogic
Copy link
Member

QuLogic commented Jul 31, 2020

Is an image test really required here? Can you not pull the sizes from the produced collection, or is this re-ordering draw-dependent?

If that's not possible, then I think we can still use a figure comparison test instead. Just compare with a plot using individual scatter calls.

@tomneep
Copy link
Contributor Author

tomneep commented Jul 31, 2020

@QuLogic The reordering is draw dependant so I couldn't get a standard test to work using get_sizes. I took your advice and changed to a figure comparison test with individual scatter calls.

@tacaswell
Copy link
Member

tacaswell commented Aug 1, 2020

@tomneep Can you squash this to one commit (or we can squash-merge it)? As it is the image will still be in the history (and we are trying to keep the repo from getting even bigger than it already is).

Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

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

Modulo rebase, or we can squash.

@tomneep
Copy link
Contributor Author

tomneep commented Aug 1, 2020

@tacaswell Makes sense. I've rebased and squashed into a single commit.

@jkseppan jkseppan merged commit 164e650 into matplotlib:master Aug 2, 2020
@jkseppan
Copy link
Member

jkseppan commented Aug 2, 2020

Thanks @tomneep!

meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Aug 2, 2020
timhoffm added a commit that referenced this pull request Aug 2, 2020
…136-on-v3.3.x

Backport PR #18136 on branch v3.3.x (Sort 3d sizes along with other properties)
@tomneep tomneep deleted the mplot3d_scatter_sizes branch August 19, 2021 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Point size array in the Axes3D scatter() does not follow the same order as in the data points
6 participants