matplotlib.__version__= 1.5.1 (installed as part of anaconda distribution)
Python 3.4.4
OS X
Issue
Code from examples/units/radian_demo.py with minor modifications:
import numpy as np
from basic_units import radians, degrees, cos
from matplotlib.pyplot import figure, show
x = [val*radians for val in np.arange(0, 15, 0.01)]
fig = figure()
ax = fig.add_subplot(121, projection='polar')
line1, = ax.plot(x, np.array(cos(x))+1, xunits=radians)
ax = fig.add_subplot(122, projection='polar')
line2, = ax.plot(x, np.array(cos(x))+1, xunits=degrees)
show()
Notes
Note that the plot on the left is correct, but the angular tick labels aren't incrementing correctly. I can't tell if this is an issue with the basic_units.py example implementation or the units interface.
If it seems like a straightforward fix, I'd be happy to take a look at it: the units interface is really slick and it would be great to get this working with polar coordinates too.
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
So, given that basic units is quite stripped down and only really intended for narrow usage in examples, I'm inclined to lean towards just closing, though I could see figuring out why it is broken here (and other unit libraries are not).
Edit: just realized that the ticks are in degrees in both plots, so perhaps still something to look at there... was focused on the shape and the axis labels of the degrees plot, forgot to check the radians one as closely. Behavior in that regard is identical for both unyt and pint
I will note that the basic_units.py version is slightly changed.
In addition to simple style changes, the ticks for the degrees plot are shown at integers (at the radians, to be precise) for 0-6 (with the degree sign, still) rather than evenly spaced, repeating 3 as it was originally.
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
Activity
QuLogic commented on Mar 11, 2016
Probably related to #4905.
github-actions commented on Mar 23, 2023
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
ksunden commented on Mar 23, 2023
This behavior does persist, but I think it is purely a limitation of basic units, not the actual polar axes (not fully sure how...)
When I convert the example code to use either pint or unyt, the expected graph is produced for both radians and degrees as the xunits.
Using pint (use unit registry, np.cos instead of imported cos):
So, given that basic units is quite stripped down and only really intended for narrow usage in examples, I'm inclined to lean towards just closing, though I could see figuring out why it is broken here (and other unit libraries are not).
Edit: just realized that the ticks are in degrees in both plots, so perhaps still something to look at there... was focused on the shape and the axis labels of the degrees plot, forgot to check the radians one as closely. Behavior in that regard is identical for both unyt and pint
ksunden commented on Mar 23, 2023
I will note that the basic_units.py version is slightly changed.
In addition to simple style changes, the ticks for the degrees plot are shown at integers (at the radians, to be precise) for 0-6 (with the degree sign, still) rather than evenly spaced, repeating 3 as it was originally.
github-actions commented on Mar 25, 2024
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!