usingMakief(x::Real,r::Real)=r*x*(1-x)functioncobweb(xᵢ::Real,curve_f::Function,r::Real;nstep::Real=30)::Vector{Point2f0}# col 1 is x, col 2 is ya=zeros(nstep*2,2)a[1,1]=xᵢx=xᵢy=curve_f(x,r)ret=similar(Vector{Point2f0},nstep*2)fori∈2:2:nstep*2-2a[i,1]=xa[i,2]=yx=yy=curve_f(x,r)a[i+1,1]=xa[i+1,2]=xret[i]=Point2f0(a[i,1],a[i,2])ret[i+1]=Point2f0(a[i+1,1],a[i+1,2])endreturnretendxᵢ=0.1rᵢ=2.8xr=0:0.001:1## setup sliderssx,x=textslider(0:0.01:1,"xᵢ",start=xᵢ)sr,r=textslider(0:0.01:4,"r",start=rᵢ)## setup liftsfs=lift(r->f.(xr,r),r)cw=lift((x,r)->cobweb(x,f,r),x,r)## setup plotssc=lines(# plot x=y, the bisector linexr,# xsxr,# yslinestyle=:dash,# style of linelinewidth=3,# width of linecolor=:blue# colour of line)sc[Axis][:names][:axisnames]=("x(t)","x(t+1)")# set axis nameslines!(sc,xr,fs)# plot the curvelines!(sc,cw)# plot the cobwebfinal=hbox(sc,vbox(sx,sr))record(final,"output.mp4",range(0.01,stop=5,length=100))doir[]=iend