Remove direct manipulation of HostAxes.parasites by end users. #23579
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Directly manipulating a list of child axes is strange compared to the
standard Matplotlib axes creation API, so don't use that in mpl_toolkits
parasite axes either. Instead, use the already existing get_aux_axes
API. However, that API needs to be improved to support arbitrary
kwargs that get forwarded to the Axes constructor, which is easy to do.
Also replace the default axes_class in that API by _base_axes_class,
which is consistent with HostAxes.twin()/twinx()/twiny(), and also
corresponds to the practical use cases demonstrated in the examples: if
the host axes class is from axisartist, the parasite axes class is also
from axisartist (see examples/axisartist/demo_parasite_axes.py); using
another parasite axes class won't work.
This is preliminary work for making parasite_axes a thin wrapper around
standard child_axes.
PR Summary
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).