I am having a problem with the Pandas graphics box in the subtitle. Based on the two methods I'm trying to do, creating a boxplot either removes all the subheadings that I already created, or breaks the box after the subnet grid. But I can not depict it in a subnet grid.
import matplotlib.pyplot as plt import pandas from pandas import DataFrame, Series data = {'day' : Series([1, 1, 1, 2, 2, 2, 3, 3, 3]), 'val' : Series([3, 4, 5, 6, 7, 8, 9, 10, 11])} df = pandas.DataFrame(data)
The first thing I tried is the following:
plt.figure() plt.subplot(2, 2, 1) plt.plot([1, 2, 3]) plt.subplot(2, 2, 4) df.boxplot('val', 'day')
But it just creates a plot without subplots:


So, I then tried to set the axis manually:
plt.figure() plt.subplot(2, 2, 1) plt.plot([1, 2, 3]) plt.subplot(2, 2, 4) ax = plt.gca() df.boxplot('val', 'day', ax=ax)
But it just destroyed the subnet grid together, as well as the initial image:

Any ideas on how I can get the boxplot image in the lower right grid in the subheadings (the one that is empty in the first image set)?