plot3: improve data processing  for plot3