jeudi 28 juillet 2016

plotting a sequence results in: "ValueError: x and y must have same first dimension"

I'm a beginner here and I'm experiencing a problem when I'm trying to plot a sequence:

My code gives me this error message: "ValueError: x and y must have same first dimension"

hold(True)
x=[0.5]
for r in arange(2,4,0.1):
    for i in range(170):
        xn= x[-1]
        xnp1 = r*xn*(1-xn)
        x.append(xnp1)
        xa=array(x)   
        rplot=0*xa+r
plot (rplot, xn,".")
show()

Aucun commentaire:

Enregistrer un commentaire