Skip to content

Re-cache Line2D path when transform changed #24817

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dstansby
Copy link
Member

PR Summary

When the transform of a Line2D is changed, re-calculate the transformed path. This is needed in the case of polar plots where a line is drawn, and the radial limits on the axes changed. This changes the transform of the line, which requires recomputation of its path. Because only the non-affine part of the transform is cached in Line2D, this does not show up for normal cartesian axes, because changing the y-limits does not change the non-affine part of the transform.

Fixes #24790

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (and pytest passes)
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

@dstansby
Copy link
Member Author

Hmm, it turns out that this breaks path caching. In general what I want to do here is check if the non-affine part of the transform has changed, but as far as I can tell that's not possible with the current transforms API?

@QuLogic
Copy link
Member

QuLogic commented Mar 8, 2023

According to @anntzer in #25282, INVALID_NON_AFFINE is never used, so I guess only checking for a full invaldation is possible.

@afarcy
Copy link

afarcy commented Jul 19, 2023

Is there a chance that a combination of both PRs could solve the issue ?

@dstansby dstansby marked this pull request as draft January 6, 2024 09:42
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]: Polar plot wrong Y values when set_ylim is used
3 participants