-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Allow non-default scales on polar axes #24825
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
Conversation
e43a1dd
to
255d385
Compare
t *= self._axis.get_theta_direction() | ||
t += self._axis.get_theta_offset() | ||
theta *= self._axis.get_theta_direction() | ||
theta += self._axis.get_theta_offset() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to add a test that uses these lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like _apply_theta_transforms=True
case is not used internally, but as a backwards compatability wrapper for users who used PolarTransform
before its behaviour was changed. I think adding a meaninful test would be tricky here.
Also, can you please add a test for #12803? Or is it "obvious" that this is tested by the existing one? Oh, and possibly the other ones as well. (It seems like "Probably fixes" is interpreted as "fixes", so those will be closed upon merging this with the current statement.) In general, I think this all looks good, but since I do not really know the area well enough I can only comment on details. (The previous PR was small enough for me to understand...) |
I think it's obvious, in that it's the same bug that was causing both #12803 #24383 (that I've fixed and added a test to).
I've updated the comment so these aren't closed if/when this PR is merged. After a bit more investigation I think this fixes them a bit, but not fully. |
98edcfd
to
3ed366b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good as far as I can tell!
Unsure about 3.7 or 3.8, so I'll try to get some clarity during the dev-call tonight and then merge accordingly.
lib/matplotlib/tests/test_polar.py
Outdated
ax = fig.add_subplot(polar=True) | ||
|
||
ax.set_yscale('log') | ||
ax.set_ylim(1, 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For clarity, I would use set_rscale
and set_rlim
.
Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
…825-on-v3.7.x Backport PR #24825 on branch v3.7.x (Allow non-default scales on polar axes)
PR Summary
After a long excursion down the rabbit hole of polar Axes transforms, I have emerged to working log-polar axes! Unsurprisingly the fix was trivial - see 82d5c5f. While I was at it the other commits add some more commenting and tidy up some code. Please leave critical reviews and suggestions, would be good to address them while I still have all this context in my head!
Based on top of #24763
Fixes #24383
Fixes #12803
Fixes probaby #7751
Fixes probably #5527
PR Checklist
Documentation and Tests
pytest
passes)Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst