How to add a new subplot to a figure created by pandas?

Question:

I’m creating a plot from pandas dataframe using pandas.DataFrame.plot(), which creates 3×2 subplots. I want to add a new subplot to the final spot. However, it doesn’t appear. What could be the solution?

ax = DF.plot(x = 'time', 
         y = ['A', 'B', 'C', 'D', 'E'], 
         kind = 'line',
         subplots ='True', 
         layout = (3, 2),
         figsize = (12*2/2.54, 8*3/2.54))
DF.plot(x = 'A', 
        y = 'B', 
        kind = 'line',
        ax = ax[2, 1])
Asked By: Aset Muratuly

||

Answers:

Unhide the last subplot using set_visible:

DF.plot(x = 'A', 
        y = 'B', 
        kind = 'line',
        ax = ax[2, 1])
ax[2, 1].set_visible(True)
Answered By: BigBen
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.