-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Single path optimisation for Collection w/ offsets broken #16496
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
Comments
FWIW I think offset_position="data" should be deprecated. See #13696, #16461 (comment). |
Changes to |
Ah, I didn't realize |
@dstansby RC for which version? |
ok, the fixes here seem to be:
in order of most correct to simplest. If we want to fix this for 3.2, we should go with the last one, if we want to target this at 3.3 we should go with the first one. |
The problem of the last approach is that you'd need to change the baseline images, as discussed above. |
I missed #16517 earlier (which basically implements the last one). Sorry, I am being very dense, why does that require regenerating test images? |
Becauses images with and without single path optimization are different (because single path optimization is based on stamping which means snapping to nearest pixels, whereas without SPO, you don't snap). |
Ah but wait, this was resolved via #16517 (comment). |
This is as old as 2.0.2 at least. In 1.5.3, both paths are drawn at (0, 0), which I guess is a slight improvement. But this is a very long-standing bug. |
|
#13696 deprecated transOffset=mtransforms.IdentityTransform(),
offset_position="data" with transOffset=mtransforms.AffineDeltaTransform(ax.transData), works. I think we can close this now, as the code path will eventually get deleted? |
This is fixed for 3.3, and it doesn't look like anyone's going to open a simpler PR for 3.2.2. |
This is the root cause of #16461. The single path optimisation does not correctly take into account offsets:
matplotlib/lib/matplotlib/collections.py
Lines 354 to 362 in acc7ecb
As an example, this code creates two collections which differ only by their
edgecolors
, and have an offset of[0.5, 0.5]
. In both cases the collection should be drawn at the offset, but only the collection withedgecolors=None
is correct, because this does not follow the 'optimised' code path above.The text was updated successfully, but these errors were encountered: