fix plot resize bug