Optimise plotting.
Remove duplicate points to speed up plotting and reduce file size.