Optimise plotting routines.