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
  • 21,988
  • 13
  • 81
  • 109
baklan
  • 187
  • 3
  • 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
  • 300,191
  • 65
  • 633
  • 696
  • 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,443
  • 1
  • 20
  • 32