I plotted two different subplots using matplotlib.plt and pandas.DataFrame.plot.
Both figures are stored in the same pandas dataframe, which I called f. You can download the sample data here.
One of these plots cannot be described by a function (that is, one x value can yield two or more y values. This is what's causing the issue (I'm trying to plot a square).
I tried:
f[f['figure'] == 'fig1'].plot(x='x_axis', y='y_axis', legend=False)
f[f['figure'] == 'fig2'].plot(x='x_axis', y='y_axis', legend=False)
plt.show()
I want both subplots combined into a single one. Is there a way to plot the second subplot in the same subplot as the first? I want to stack both figures in a single subplot.


f['y_axis].plot(...), but this wouldn't work withf[f['figure].eq('fig1')]because I also have to specifyx_axis. Does this make sense?