optimizing graphics plot