How can I show figures separately in matplotlib?

Posted by Federico Ramponi on Stack Overflow See other posts from Stack Overflow or by Federico Ramponi
Published on 2010-03-07T20:18:04Z Indexed on 2010/03/08 8:21 UTC
Read the original article Hit count: 497

Filed under:
|
|

Say that I have two figures in matplotlib, with one plot per figure:

import matplotlib.pyplot as plt

f1 = plt.figure()
plt.plot(range(0,10))
f2 = plt.figure()
plt.plot(range(10,20))

Then I show both in one shot

plt.show()

Is there a way to show them separately, i.e. to show just f1?

Or better: how can I manage the figures separately like in the following 'wishful' code (that doesn't work):

f1 = plt.figure()
f1.plot(range(0,10))
f1.show()

© Stack Overflow or respective owner

Related posts about python

Related posts about matplotlib