How to use variable number arguments to pyplot.plot?
<p>This is my data and the graph I want to produce:</p>

<pre><code>from numpy import array
from os.path import expanduser
import matplotlib.pyplot as plt
sns.set(style="darkgrid")

data = [array([8, 4, 9, 6, 2]), array([5, 4, 4, 1, 2]), array([4, 3, 1, 5, 6]), array([8, 3, 5, 6, 4])]

for d in data:
    plt.plot(d)

# plt.savefig(expanduser("~/Documents/rural_juror.pdf"))
</code></pre>

<p><a href="https://i.stack.imgur.com/yWw8G.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yWw8G.png" alt="enter image description here"></a></p>

<p>Since I want to plot several of those in the same <code>seaborn facetgrid</code> I cannot use a loop, but have to do it on one line, like so:</p>

<pre><code>plt.plot(*data)
# produces same result as 
# plt.plot(data[0], data[1], data[2], data[3])
</code></pre>

<p>This does not work, however, but produces a graph like so:</p>

<p><img src="https://i.stack.imgur.com/mzNjs.png" alt="enter image description here"></p>

<p>I'm guessing this has to do with the arguments to plot being of the type <code>data, looks, data, looks...</code> but how do I work around this?</p>