Skip to content

Fix scatter3d color/linewidth re-projection - #18293

Merged
dopplershift merged 5 commits into
matplotlib:masterfrom
QuLogic:scatter3d-color
Aug 29, 2020
Merged

dopplershift merged 5 commits into
matplotlib:masterfrom
QuLogic:scatter3d-color

Conversation

@QuLogic

@QuLogic QuLogic commented Aug 19, 2020

Copy link
Copy Markdown
Member

PR Summary

Technically, it's tested, though the test wasn't strictly designed to do so (#18156). Not sure if I should write a different test.

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

They should be re-ordered regardless of depth shading, but rather
dependent on whether there's more than one colour.

Fixes matplotlib#18287.
@QuLogic QuLogic added this to the v3.3.2 milestone Aug 19, 2020
@timhoffm

Copy link
Copy Markdown
Member

Technically, it's tested, though the test wasn't strictly designed to do so (#18156). Not sure if I should write a different test.

How can this have been tested? The behavior was broken and is now fixed, but you did not have to change anything in the tests.

@dopplershift

Copy link
Copy Markdown
Contributor

That lines up with where codecov says exactly 0% of the lines of code touched in this PR have been executed by the test suite.

@QuLogic

QuLogic commented Aug 19, 2020

Copy link
Copy Markdown
Member Author

Sorry, I guess what is tested is the opposite case. I can write up something that should cover everything.

@QuLogic QuLogic changed the title Fix scatter3d color re-projection Fix scatter3d color/linewidth re-projection Aug 19, 2020
@QuLogic

QuLogic commented Aug 19, 2020

Copy link
Copy Markdown
Member Author

I pushed a more extensive test, and also found that linewidth was not correctly propagated, so fixed that as well.

There's still a bug in #18287 in that initial draw is not correct, but any change in the view angle re-calculates stuff so it appears correctly. I think there's some stale trigger missing in view_init, but need to investigate that for a bit.

@QuLogic

QuLogic commented Aug 20, 2020

Copy link
Copy Markdown
Member Author

I'm very confused about this initial draw thing. To be clear, this PR does fix the sorting, which you can confirm by running #18287, and then rotating the view of the first figure so that the markers's depths are reversed.

However, on the second figure, the face colours of the scatter markers are not sorted, though the edge colours are. Inserting a draw (of any kind, lazy or forced) just before plt.show() magically fixes it. As far as I can tell, Path3DCollection.do_3d_projection sorts everything exactly the same way on both draws, but somehow it doesn't reflect that in the result.

@tacaswell

Copy link
Copy Markdown
Member

I'm happy to merge this as-is without tracking down why the initial draw is wrong (which is not to say that isn't a bug that needs to be fixed).

@dopplershift dopplershift left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree, let's deal with any initial draw issues in a separate PR.

@dopplershift
dopplershift merged commit 52f7f42 into matplotlib:master Aug 29, 2020
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Aug 29, 2020
timhoffm added a commit that referenced this pull request Aug 29, 2020
…293-on-v3.3.x

Backport PR #18293 on branch v3.3.x (Fix scatter3d color/linewidth re-projection)
@QuLogic
QuLogic deleted the scatter3d-color branch August 30, 2020 01:07
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.

4 participants