catplot:
import seaborn as sns
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=[10,5])
titanic = sns.load_dataset("titanic")
sns.catplot(ax=ax, x="sex", y="survived", hue="class", kind="bar", data=titanic);
relplot:
fig, ax = plt.subplots(figsize=[10,5])
titanic = sns.load_dataset("titanic")
sns.relplot(ax=ax, x="sex", y="survived", hue="class", data=titanic);
plt.title("This plot is active")
barplot does work as expected:
fig, ax = plt.subplots(figsize=[10,5])
titanic = sns.load_dataset("titanic")
sns.barplot(ax=ax, x="sex", y="survived", hue="class", data=titanic);
plt.title("This plot is active")
I am expecting both catplot and relplot to also show exactly one frame instead of two
http://seaborn.pydata.org/introduction.html#figure-level-and-axes-level-functions
I am just going to add this here referenced from https://github.com/mwaskom/seaborn/issues/1514 in case someone like me stumbles upon this issue when using catplot with subplots.
plt.close(2) helps to hide the 2nd empty graph
Most helpful comment
I am just going to add this here referenced from https://github.com/mwaskom/seaborn/issues/1514 in case someone like me stumbles upon this issue when using
catplotwithsubplots.