Bifurcation Diagram of Logistic map

Clear["Global'*"];

setup

f[x_,r_]:=r*x*(1-x);    (* The map *)
data={}; (* main list of data *)
nd=300; (* number of initial iterations to be dropped *)
nfp=128; (* number of last iterations prescribed as fixed points *)
rmin=2.5; rmax=4.0;  (* r-interval *)
dr=(rmax-rmin)/200; (* increasing step of parameter r *)

run

r=rmin; 
x0=0.1; (* initial point *)
While[r<rmax, 
x=x0 ; 
For[i=1,i≤nd ,i++, x=f[x,r]];
For[i=1,i≤nfp ,i++, x=f[x,r]; AppendTo[data,{r,x}]];
r=r+dr;
]
(* Bifurcation plot *)
ListPlot[data,PlotRange->{{2.5,4},{0,1}},PlotStyle->PointSize[0.005]]