I am trying to create subplots of a column in pandas dataframe grouped by each of the other columns. Here I create and iterate through subplots and attempt to add a boxplot to each one.
fig, axes = plt.subplots(nrows=2, ncols=2) # create 2x2 array of subplots
axes[0,0] = df.boxplot(column='price') # add boxplot to 1st subplot
axes[0,1] = df.boxplot(column='price', by='bedrooms') # add boxplot to 2nd subplot
# etc.
plt.show()
this results in
As you can see, the boxplots are not being added to the subplots. I am not sure where I am going wrong. All the documentation I have found says that [0,0] is the upper left corner, and the boxplots work.. I need to use df.boxplots() specifically.