polar plot incorrectly handles units of degrees/radians · Issue #6144 · matplotlib/matplotlib · GitHub
Skip to content

polar plot incorrectly handles units of degrees/radians #6144

Description

@jmdearman

Setup

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()

figure_1

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions