Plot management in Python