您可以使用以下命令简单地将图形设置
f1为新的当前图形:
pl.figure(f1.number)
另一个选择是为数字赋予名称(或数字),这可能有助于使代码更易于阅读:
pl.figure("Share values")# ... some plots ...pl.figure("Profits")# ... some plots ...pl.figure("Share values") # Selects the first figure again实际上,数字“数字”可以是字符串,可以说比简单数字更明确。
PS :本pyplot相当于
pylab.figure()IS
matplotlib.pyplot.figure()。



