I am new to matplotlib and am trying to get my head around how to add figures to a subplot.
I have three different functions, which output a single figure:
def plot_fig_1(vars, args):
f, ax, put.subplots()
# do something
ax.plot(x, y)
return f, ax
def plot_fig_2(vars, args):
f, ax, put.subplots()
# do something
ax.plot(x, y)
return f, ax
Now, for example I would like to merge both figures into a single plot with shared X axis. I tried:
f_1, ax_1 = plot_fig_1(...)
f_2, ax_2 = plot_fig_2(...)
new_fig, new_ax = plt.subplots(2,1)
new_ax[0] = f_1
new_ax[1] = f_2
and here I am basically lost. I'm reading the Matplotlib manual, but no luck so far.