change plotdata to plotstate