-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
add_subplot(..., axes_class=...) for more idiomatic mpl_toolkits usage. #18573
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
|
||
# axes for colorbar | ||
ax_cb = Axes(fig, divider.get_position()) | ||
# (the label prevents Axes.add_axes from incorrectly believing that the two |
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.
projection_class, extra_kwargs = projection._as_mpl_axes() | ||
kwargs.update(**extra_kwargs) | ||
"Cannot combine 'axes_class' and 'projection' or 'polar'") | ||
projection_class = axes_class |
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.
You and I have crossing PRs, so its pretty important for my rebases that you have tests if possible
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.
sorry about that, added a test
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.
This line still doesn't have a test according to codecov. I can probably be careful in my rebase, but....
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.
hopefully better now
9560d79
to
cafdff1
Compare
now with docs! |
lib/matplotlib/figure.py
Outdated
@@ -1129,6 +1138,10 @@ def add_axes(self, *args, **kwargs): | |||
polar : bool, default: False | |||
If True, equivalent to projection='polar'. | |||
|
|||
axes_class : subclass type of `~.axes.Axes`, optional | |||
The `.axes.Axes` subclass that is instantiated. This parameter | |||
is incompatible with *projection* and *polar*. |
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.
This is somewhat mysterious. Can we link to an example here?
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.
do you want to pick one? :)
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.
I dunno, which ever subclass gets used the most?
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.
I found the right thing to link.
PR Summary
Implements #18548, see discussion there.
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
andpydocstyle<4
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).