multiple plots with function matplotlib
<p>I created a function that creates a plot, basically the function looks like this:</p>

<pre><code>def draw_line(array):
    fig, ax = plt.subplots()
    ax.plot(array)
</code></pre>

<p>I wanted to know if there is a way to call this function when wanting to do multiple plots in a figure. In particular, I wanted to do something like:</p>

<pre><code>fig, axes = plt.subplots(nrows=2, ncols=3)
for i in list:
axes[i] = draw_line(*list[i]) 
</code></pre>

<p>However, what I get is an empty grid with the actual plots below.</p>