How to plot an equation with multiple variables in Python?
<p>Suppose I have a variable list z</p>

<pre><code>z = [1,2,3,4,5,6,7,8,9,10]
</code></pre>

<p>I am trying to plot the equation</p>

<pre><code>y = 1a + 2b + 3c + 4d + 5e + 6f + 7g + 8h + 9i + 10k
</code></pre>

<p>I am confused on how to plot a multi dimensional equation in python. I use the matplotlib library now. Any suggestions?</p>

<p>Try this:</p>

<pre><code>z = [1,2,3,4,5,6,7,8,9,10]
equation="y ="
for i in range(len(z)):
    if i&gt;0:
        equation=equation+" +"
    equation=equation+" "+str(z[i])+chr(ord('a')+i)
print equation
</code></pre>

<p>The output is:</p>

<pre><code>y = 1a + 2b + 3c + 4d + 5e + 6f + 7g + 8h + 9i + 10j
</code></pre>

python numpy matplotlib