-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
[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
[mpl_toolkits] Allow "figure" kwarg for host functions in parasite_axes #4863
Conversation
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.
don't do equality comparison to None. Always do is and is not.
|
Also needs documentation (although, I am not clear where...). Besides the equality comment, this makes sense to me. Don't know why it wasn't coded that way before... |
|
@WeatherGod thanks for your correction. Both of these functions weren't documented (except for their usage in examples) to begin with, so I'm not sure either. The whole AxesGrid toolkit seems a bit neglected to me, do people still use it? |
|
Oh, absolutely it gets used. It is one of the more popular toolkits. On Tue, Aug 4, 2015 at 5:23 PM, productivememberofsociety666 <
|
|
Someone else just contributed some docs: #4864 |
|
In fact, you might be interested in #4864 (just submitted) where someone gives some love to the documentation. |
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 would do this as
fig = kwargs.get('figure', None)
if fig is None:
fig = plt.gcf()|
Sorry this languished, in the future leave a comment after you finish with edits. We don't get notifications on commit pushes, just comments. |
…xes_not_pyplot ENH: Allow "figure" kwarg for host functions in parasite_axes
|
This isn't perfect, but does not make it worse. |
|
Could you, please, point me to a minimum example of using self.fig = matplotlib.figure.Figure(figsize=(8,8))is defined? |
hax = host_axes([0.1,0.1,0.8,0.8], figure=fig)
hax.plot([0,1,2,3],[1,2,4,8])
fig.savefig("some_file.png")Result looks very broken though, even when I set I'm using |
|
@smheidrich Thanks! |
Currently,
host_axesandhost_subplotofmpl_toolkits.axes_grid1work onpyplotonly. This patch allows a kwargfigure(defaulting topyplot.gcf()) to be passed so it becomes possible to use them on arbitrary figures as well.