I am trying to make an iterative map and plot it. I am just starting to learn python.
Here is my code: I feel I am making an amature mistake in syntax, my code only gives my a straight line.
N = 10000
aa = linspace(2, 4, N)
xx = zeros(N)
for jj in range(N):a = aa[jj]
x0 = rand()
for ii in range(1, 100): x0 = a *x0 *(1 -x0)
xx[jj] = x0
plot(aa, xx, '.')
What am I doing wrong?
thanks.
With python the indenting is more important than in other languages.
Just by rearranging your code (and putting in namespaces and such, so it’s obvious where functions are coming from), i get this:
Here is the code: