At the moment you can not do it in a simple way. Some plots in seaborn
are defined at the figure-level (e.g. lmplot, factorplot, jointplot etc.) and they do not accept the axis argument.
If you really want to create subplots you can follow this answer here which includes a support class (SeabornFig2Grid
) to do exactly what you need. Here an example of that class in use:
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import seaborn as sns; sns.set()
df = pd.DataFrame(dict(
Attack = np.random.random(20),
Defense = np.random.random(20)))
g0 = sns.lmplot(data= df, x='Attack', y= 'Defense')
g1 = sns.jointplot(data= df, x='Attack', y= 'Defense', kind='scatter',color='purple')
fig = plt.figure(figsize=(8,4))
gs = gridspec.GridSpec(1, 2)
mg0 = SeabornFig2Grid(g0, fig, gs[0])
mg1 = SeabornFig2Grid(g1, fig, gs[1])
gs.tight_layout(fig)
