-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Non string serialised projections #923
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
@@ -229,8 +229,10 @@ def __init__(self, *args, **kwargs): | |||
each pair of data points. Set to 1 to disable | |||
interpolation. | |||
""" | |||
self.resolution = kwargs.pop('resolution', 1) | |||
self._default_theta_offset = kwargs.pop('theta_offset', 0) |
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.
To clarify, currently when creating a PolarAxes with a theta_offset kwarg, Axes.__init__
uses setp to set the value, but PolarAxes.gca
wipes it again. This fixes this behaviour and is tested in my new _as_mpl_axes
test.
Barring a couple of documentation-related improvements, I think this is ready to go in. |
I think the latest commit improves the situation. Is this the kind of thing you had in mind? |
Much better, thanks. |
I'll rebase now then and then give it 24 hours before merging. |
Support for non string projections, exposing the _as_mpl_axes external API.
This is a rebased version of #694, which itself was a rebase of #470.
I would like the ability to setup a plot projection in MPL that can be defined by various parameters and does not need to be serialised as a string and registered with matplotlib.projections.register_projection. For example, an extension of /examples/api/custom_projection_example.py might be to add the ability to define the central meridian to an arbitrary value rather than the current value of 0 - in this case I would expect to define the projection by creating an object which can then be turned into a matplotlib axes: