optimizing plots