I have a function named make_plot
that takes as an input a list of matrices of length 15 and outputs a plot that is a 3x5 collection of heatmaps (one for each of the matrices in the list).
I would then like to display the output of this function applied to two different lists of matrices, showing the output side-by-side.
I thought this was just a simple application of matplotlib subplots, as discussed here: https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subplots_demo.html
However, I haven't figured out how to get the output of my custom function make_plot
to fit into the subplots that I would like.
For example, the provided code on the matplotlib site for how to make horizontal plots is
fig, (ax1, ax2) = plt.subplots(1, 2)
fig.suptitle('Horizontally stacked subplots')
ax1.plot(x, y)
ax2.plot(x, -y)
But if I try a gentle modification like
fig, (ax1, ax2) = plt.subplots(1, 2)
fig.suptitle('Horizontally stacked subplots')
ax1 = make_plot(mats1)
ax2 = mate_plot(mats2)
I get two empty plots, and then the usual outputs of make_plot
stacked on top of each other.
I feel like there is something I'm not really understanding about the nature of matplotlib objects, this seems like it should be a simple / reasonable thing to do, but I haven't figured out how to do it yet. Any pointers would be so appreciated!