Dear matplotlib developers,

I prefer to use matplotlib in my scripts without its state-machine

wrapper and it works mostly nicely. One thing which is missing

currently is a standard way to display a bunch of figures using the

default backend. What I have to do now is:

from matplotlib.pyplot import figure, show

f = figure()

ax = f.add_subplot(1, 1, 1)

ax.plot(range(10))

f = figure()

ax = f.add_subplot(1, 1, 1)

ax.plot([x*x for x in range(10)])

show()

What I don't like about this approach is that figure() not only creates

a figure instance, but also a hidden reference to it somewhere in the

state machine and show uses these hidden references. I find this

inelegant.

What about adding a function "show_figures" to matplotlib (not to

matplotlib.pyplot but somewhere else) which would show all the figures

in a sequence using the default backend? Then the following would be

possible:

f1 = Figure()

ax = f1.add_subplot(1, 1, 1)

ax.plot(range(10))

f2 = Figure()

ax = f2.add_subplot(1, 1, 1)

ax.plot([x*x for x in range(10)])

show_figures([f1, f2])

or even:

show_figures([Figure().add_subplot(1,1,1).plot(range(10)),

Figure().add_subplot(1,1,1).plot([x*x for x in range(10)])])