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)])])


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to