I want to draw two parallel box plot in together. For that I used sub plots function in python, below code I used for the that process, but I couldn't get good out put from the code, because its already draw addition two empty graphs, how I remove these empty graphs from the output? Please give ideas for that?
f, axes = plt.subplots(2,2,figsize = (14,10))
sns.boxplot(x='Heating QC',y='SalePrice',hue='Central Air', data=df ,ax=axes[0,0])
sns.boxplot(x='Heating',y='SalePrice',hue='Central Air', data=df ,ax=axes[0,1])
out put
After changes got below outputs
IndexError Traceback (most recent call last)
<ipython-input-543-7dfa6ebf0390> in <module>
1 f, axes = plt.subplots(1,2,figsize = (14,10))
----> 2 sns.boxplot(x='Heating QC',y='SalePrice',hue='Central Air', data=df ,ax=axes[0,0])
3 sns.boxplot(x='Heating',y='SalePrice',hue='Central Air', data=df ,ax=axes[0,1])
IndexError: too many indices for array


plt.subplots(2,2)creates a 2x2 grid of subplots, that's why you've got 4 plots showing.You need to change it to to a1,2or2,1as you see fit. matplotlib.org/api/_as_gen/matplotlib.pyplot.subplots.htmlaxnow need to change to justaxes[0]andaxes[1]as you only have a one dimensional array of subplots. That's covered here: stackoverflow.com/questions/54170394/…