Optimized the plotting.