1

I'm trying to show multiple figures at once, but with an offset so I don't have to move the first figure to check that it showed all the figures (plots).

So here's an example:

from pylab import *

figure(0)
plot()

figure(1)
plot()

show()

These figures are shown on top of each other, but I want them to look like this when I run my program:

EDIT: printcreen

Any suggestions?

Glorfindel
  • 20,880
  • 13
  • 75
  • 99
baklan
  • 167
  • 2
  • 14

2 Answers2

1

I usually do this with Figure.add_subplot:

fig = figure(0)
ax = fig.add_subplot(211)
ax.plot(...)
ax = fig.add_subplot(212)
ax.plot(...)
show()

If you're wondering what the magic 211 and 212 mean, see this question.

Community
  • 1
  • 1
mgilson
  • 283,004
  • 58
  • 591
  • 667
  • Thanks for the answer, although my question might have been unclear, I was looking for another kind of solution, I added an example in my post. – baklan Jun 19 '13 at 12:47
0

If you're using the tkagg backend, you can do:

import matplotlib.pyplot as plt

for i in range(5):
   fig = plt.figure()
   fig.canvas._tkcanvas.master.geometry('800x600+{:d}+{:d}'.format(70*i,70*i))

plt.show()

I think that the same treatment could be used for others backends...

Regards

Pablo
  • 2,363
  • 1
  • 19
  • 32