Method that plots i all the x values to a given math function
<p>Hey i need help with programing a method that plots i all the x values to a given math function</p>

<pre><code>def compute(expression):  #The expression is where the math function is gonna be placed
    print("Evaluerer", expression)

    for i in range(0,1001):
        x=i/100.0 #This is all the x-values, which needs to be put into the expression
</code></pre>

<p>Thanks for replying </p>

<p>Define your function :</p>

<pre><code>def f(x):
    return x #put here your expression of f(x)
</code></pre>

<p>Then plot your function as follow:</p>

<pre><code>plt.plot([i/100.0 for i in range(0,1001)], map(lambda x: f(x),[i/100.0 for i in range(0,1001)]))
</code></pre>

python