Skip to content

Allow custom figure for subplot grid in axisgrid#3917

Open
pas-calc wants to merge 2 commits into
mwaskom:masterfrom
pas-calc:patch-1
Open

Allow custom figure for subplot grid in axisgrid#3917
pas-calc wants to merge 2 commits into
mwaskom:masterfrom
pas-calc:patch-1

Conversation

@pas-calc

Copy link
Copy Markdown

Allow figure-level JointGrid plot to be defined on already-existing (sub)figure.

MWE:

fig=plt.figure()
subfigs=fig.subfigures(2) # 2 subfig rows
J = sns.JointGrid(data=df, x=x,y=y, f=subfigs[0]) # init JointGrid on subfigure
J.plot(sns.scatterplot, sns.boxplot) # plot: joint, marginals
ax=subfigs[1].subplots() # some other data
# ax.plot([1,2,3],[4,9,3]) # other data
plt.show()

we could also add this option to the convenience function sns.jointplot (extra kwargs are not passed to JointGrid init)
with a default None figure.

related
#399
#2059

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant