8000 [mpl_toolkits] Allow "figure" kwarg for host functions in parasite_axes by smheidrich · Pull Request #4863 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

[mpl_toolkits] Allow "figure" kwarg for host functions in parasite_axes #4863

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

Merged
merged 5 commits into from
Nov 5, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added doc strings.
  • Loading branch information
none committed Aug 5, 2015
commit 9c2488772c1d70d67396c110b857e5c6cc72c2f8
24 changes: 24 additions & 0 deletions lib/mpl_toolkits/axes_grid1/parasite_axes.py
8000
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,18 @@ def host_subplot_class_factory(axes_class):


def host_axes(*args, **kwargs):
"""
Create axes that can act as a hosts to parasitic axes.

Parameters
----------
figure : `matplotlib.figure.Figure`
Figure to which the axes will be added. Defaults to the current figure
`pyplot.gcf()`.

*args, **kwargs :
Will be passed on to the underlying ``Axes`` object creation.
"""
import matplotlib.pyplot as plt
axes_class = kwargs.pop("axes_class", None)
host_axes_class = host_axes_class_factory(axes_class)
Expand All @@ -497,6 +509,18 @@ def host_axes(*args, **kwargs):
return ax

def host_subplot(*args, **kwargs):
"""
Create a subplot that can act as a host to parasitic axes.

Parameters
----------
figure : `matplotlib.figure.Figure`
Figure to which the subplot will be added. Defaults to the current
figure `pyplot.gcf()`.

*args, **kwargs :
Will be passed on to the underlying ``Axes`` object creation.
"""
import matplotlib.pyplot as plt
axes_class = kwargs.pop("axes_class", None)
host_subplot_class = host_subplot_class_factory(axes_class)
Expand Down
0