Add legends to Python figures