You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inconsistent use of angle units (degrees vs radians) in polar axes #4986
When making a polar plot the units used for input data are radians, however the axes produced for the plot are in degrees. This seems unnecessarily confusing. A short illustrative example is provided below:
import matplotlib.pyplot as plt
theta = [1.5, 3, 10, 90, 180]
r = range(1,6)
ax = plt.subplot(111,polar=True)
ax.scatter(theta,r)
plt.show()
This extends to the placing of axis labels etc, i.e. to move the r axis labels to the vertical grid line you use degrees:
Im not sure this is in scope for 2.0 but in the long run I think the issues in #4897 shows clearly that the unit system needs some work and this should include issues like this one IMHO
This is really a mess. Radians/degrees seem to be chosen randomly:
Radians:
internally used coordinates and given data points
positional arguments in set_thetalim
get/set_theta_offset
Degrees:
keyword arguments in set_thetalim
get/set_thetamin/max
parameter offset in set_theta_zero_location
set_thetagrids
I'm not even sure which API I would like to have. Does anybody have thoughts on this? Maybe we can then come up with a reasonable migration strategy, e.g. with warnings depending on data with typical ranges ~ -2pi:pi vs -360:360.
My personal preference would be for radians, because that matches what numpy uses basically everywhere (even in things such as np.unwrap, which are not bound by consistency with C functions (sin, cos, etc.)). Also it would be quite hard to really insulate the internals which for now are, well, using radians. OTOH I agree anything consistent, whether degrees everywhere or radians everywhere, would be nicer than the current mess.
I agree that changing everything to radians is technically simpler. The only concern I have here is that the axis is labelled in degrees, which would still be somewhat awkward.
Would it be possible to "set" matplotlib to degree or radian mode?
AFAIR we've refrained from such approaches because of the added complexity. Also, it wouldn't make the interface more consistent unless you fully implement both versions, which is more work than even coercing to one choice of angles.
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!
IMHO this is fundamentally reasonable and we should keep it open in an aspirational sense. But unless someone is stepping up there’s likely no near-term action.
Activity
jenshnielsen commentedon Aug 25, 2015
Im not sure this is in scope for 2.0 but in the long run I think the issues in #4897 shows clearly that the unit system needs some work and this should include issues like this one IMHO
timhoffm commentedon Feb 11, 2020
This is really a mess. Radians/degrees seem to be chosen randomly:
Radians:
set_thetalimget/set_theta_offsetDegrees:
set_thetalimget/set_thetamin/maxoffsetinset_theta_zero_locationset_thetagridsI'm not even sure which API I would like to have. Does anybody have thoughts on this? Maybe we can then come up with a reasonable migration strategy, e.g. with warnings depending on data with typical ranges ~ -2pi:pi vs -360:360.
jklymak commentedon Feb 11, 2020
This is part of a "project", but I agree this API problem is pretty urgent!
I would guess most folks would prefer degrees, but?
anntzer commentedon Feb 11, 2020
My personal preference would be for radians, because that matches what numpy uses basically everywhere (even in things such as np.unwrap, which are not bound by consistency with C functions (sin, cos, etc.)). Also it would be quite hard to really insulate the internals which for now are, well, using radians. OTOH I agree anything consistent, whether degrees everywhere or radians everywhere, would be nicer than the current mess.
timhoffm commentedon Feb 11, 2020
I agree that changing everything to radians is technically simpler. The only concern I have here is that the axis is labelled in degrees, which would still be somewhat awkward.
gewoondim1 commentedon Feb 11, 2020
Would it be possible to "set" matplotlib to degree or radian mode?
timhoffm commentedon Feb 11, 2020
AFAIR we've refrained from such approaches because of the added complexity. Also, it wouldn't make the interface more consistent unless you fully implement both versions, which is more work than even coercing to one choice of angles.
10 remaining items
github-actions commentedon Jan 29, 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!
timhoffm commentedon Feb 29, 2024
IMHO this is fundamentally reasonable and we should keep it open in an aspirational sense. But unless someone is stepping up there’s likely no near-term action.