optimize plots