Optimize plot clearing