Skip to content

Conversation

@anntzer
Copy link
Contributor

@anntzer anntzer commented Apr 20, 2021

Special-casing a check for get_xaxis_transform() is a bit ugly and
definitely not general, but fixes the main issue at hand...

(Shortening the variable names to _trf mostly helps avoiding line
continuations, and I also made the layout in _update_line_limits and
_update_patch_limits closer to one another; the main relevant change
feature-wise is just the if name != "rectilinear" blocks.)

"Fixes" (effectively) #20030 by adding a special case, but this is not a general solution

PR Summary

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

if patch.get_data_transform() != self.transData:
patch_to_data = (patch.get_data_transform() -
self.transData)
xys = patch_to_data.transform(xys)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note that get_patch_transform() + get_data_transform() == get_transform() == patch_trf

Special-casing a check for get_xaxis_transform() is a bit ugly and
definitely not general, but fixes the main issue at hand...

(Shortening the variable names to _trf mostly helps avoiding line
continuations, and I also made the layout in _update_line_limits and
_update_patch_limits closer to one another; the main relevant change
feature-wise is just the `if name != "rectilinear"` blocks.)
@anntzer anntzer force-pushed the polar-xaxis-trf-datalim branch from 801ce67 to 6731f2c Compare May 17, 2021 12:19
return

updatex, updatey = line_trf.contains_branch_seperately(self.transData)
if self.name != "rectilinear":
Copy link
Member

Choose a reason for hiding this comment

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

We store the projection in a public attribute ax.name? That seems ripe for abuse? I took a quick look around and this is not used a lot. Is this actually how we tell what the projection is?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is at least how Line2D.recache() (which, although slightly obscure, is very often indirectly called in practice) does the same check. It's not clear either to me how else we could check that...

@jklymak jklymak merged commit cf31ef0 into matplotlib:master May 26, 2021
@anntzer anntzer deleted the polar-xaxis-trf-datalim branch May 26, 2021 17:01
@QuLogic QuLogic added this to the v3.5.0 milestone May 26, 2021
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