-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
BUG: Fix face orientations of bar3d #12259
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
BUG: Fix face orientations of bar3d #12259
Conversation
Worked out how to parametrize the test. Let me know if you'd like to see the test in a separate PR, to make the result easier to compare. Edit: Done in #12273 - will rebase this after that. |
c894a71
to
d6d43e9
Compare
Would it be possible to stick the test images on different axes on the same figure (something like |
I avoided that because it leads to a 100% diff in the target image, and also removes the ability to use pytest.parametrize. However, I'm not super committed to that decision - if you think that'd be best, can you comment to that effect on #12273? |
d6d43e9
to
b527911
Compare
Might also be worth considering changing the default lighting angle so that it doesn't hit cuboids at exactly 45 degrees causing adjacent faces to be the same color. |
b527911
to
e9b652e
Compare
I would have thought that the reason for the two bright faces is that, independent of the viewing angle, you have one bright face facing the viewer. Is this undesireable? |
@ImportanceOfBeingErnest: you have that before/after comparision in the rich diff of the result image An argument for why this should be fixed - for graphs containing both a surface and a bar plot, this will make the shading consistent. |
So for surface plots the lightsource rotates together with the coordinate frame as well. I never noticed that, but now that you mention it, it's clear. (Somehow undesired in my eyes, I would much rather have the lightsource constant in the room and rotate the plot alone, instead of rotating the whole room with its lights, but that's not for debate here I guess.) Would there be any way to make it consistent for the zero-extent bar as well? |
Ugh, I didn't see you'd replied here.
I agree, that would be a neat feature. I'm working on adding shading to some extra plots- once that's done, maybe I'll investigate a fixed light source.
That's a bug I'd rather not deal with yet that comes down to z-sorting coincident faces. We only got away with it before because the upper and lower faces were the same color. I'd prefer to leave that to a later PR, where the approach would be either:
Before I can reasonably do that, I'd like to get this and then #12136 in. |
Why did the notshaded baseline image change? |
e9b652e
to
7bcc001
Compare
Not sure why CI fails |
Looks like it maybe just needs rebasing on top of a commit with CI configured. Shall I go ahead and do that? |
This makes the next commit easier to follow
Fixes matplotlib#12138, which is caused by these incorrect orientations. This also corrects _generate_normals to use a counterclockwise convention
7bcc001
to
67fc7c1
Compare
@dstansby: Rebased |
67fc7c1
to
05c60cc
Compare
Was hoping you'd merge rather than squash to keep me from having to rebase. Oh well - thanks for putting this in anyway! |
The stickiness has caught me out in the past too. |
On the weekly call on 29 oct it was discussed that all PRs should be squashed-merged if possible to keep the history cleaner and reduce security risks. I think if someone does not want this to happen for their PR they should mention it. |
Hmm, that probably should be announced. I'm also not particularly for it when it's an experienced contributor. |
Sorry if squashing caused troubles. The changes seemed rather small and related so that I did not consider it important to keep separate commits. +1 that an author should explicitly mention that commits should not be squashed. |
Fixes #12138, which is caused by these incorrect orientations
I was hoping I could modify the existing bar3d test with something like:
but I couldn't work out how to make
parametrize
work with thebaseline_images
argument ofimage_comparison