I have an application where I would like to use show in a loop but as stated
in 18.1 of the manual that does not work.
# WARNING : illustrating how NOT to use show
for i in range(10):
# make figure i
So I made a workaround in a custom wxDialog with a wxStaticBitmap and a few
buttons and put the matplotlib figure in the bitmap with something like:
wi,hi = figure.get_size_inches()
width,height = bitmap_plot.GetSize()
dpi = int(min(width/wi,height/hi))
figure.savefig('/tmp/tmp.png',dpi = dpi)
image = wx.Image('/tmp/tmp.png',wx.BITMAP_TYPE_ANY)
bitmap = wx.BitmapFromImage(image)
Thus scaling the figure using the dpi option of savefig and then loading it
into the wxStaticBitmap.
To me it seems there might be a lot of unnecessary data handling. What is
the clever solution?
View this message in context: http://www.nabble.com/show-figures-in-a-loop-tp24776045p24776045.html
Sent from the matplotlib - users mailing list archive at Nabble.com.