I need to plot 5 tracks (basically 4 as two share one track), and each track is a column among many columns of my dataframe. I need to use matplotlib and subplots but since I first need to tell subplots I have 5 tracks, it would create an empty track in between my 4 tracks. If I enter 4 subplots at the beginning, it says: ValueError: not enough values to unpack (expected 5, got 4)
here are the two situations:
ax[1],ax[2] will share the same x axis (they basically need to be on the same track).
fig, [ax[0],ax[1],ax[2],ax[3],ax[4]] = plt.subplots(1, 5, figsize = (15, 30), sharey = True, dpi=300)
In this case, I will have an empty track in between my tracks, and if I put 4 subplots:
fig, [ax[0],ax[1],ax[2],ax[3],ax[4]] = plt.subplots(1, 4, figsize = (15, 30), sharey = True, dpi=300)
it will throw me an error: "ValueError: not enough values to unpack (expected 5, got 4)"
Any way to deal with this?