Plot Updating Strangeness

Hello,

I want to dynamically update a plot of the rate at which a neural network is
learning a function. Ideally, my python program would open up a window and
update the plot inside of it after every training epoch.

I have written the following code to do so:

  pyplot.title('Learning Curve')
  pyplot.xlabel('Epoch #')
  pyplot.ylabel('Success rate (%)')

  pyplot.plot(range(1, len(rates)+1), rates, 'r-')

  pyplot.draw()

Note that I am also calling pyplot.ion() at the start of the program.

This *mostly* works. However, I run into a strange issue. If the figure
window is minimized/hidden, when I open it up, nothing shows up in it (the
content is only grey). The plot will appear only if the window is
maximized/visible when the plotting occurs. If I again minimize the window
after the plot was drawn, it goes back to being gray.

···

--
View this message in context: http://www.nabble.com/Plot-Updating-Strangeness-tp25648628p25648628.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Hello,

I cannot reproduce your problem with current svn and
backends "GTKAgg", "TkAgg" and "WXAgg".

What version of matplotlib you are using? What backend?
Could you provide a stand-alone example which illustrates your problem?

I attached the example file I used to try to find your reported strangeness.

Kind regards,
Matthias

Plot_Updating_Strangeness.py (581 Bytes)

···

On Monday 28 September 2009 18:34:42 Nyx wrote:

Hello,

I want to dynamically update a plot of the rate at which a neural network
is learning a function. Ideally, my python program would open up a window
and update the plot inside of it after every training epoch.

I have written the following code to do so:

  pyplot.title('Learning Curve')
  pyplot.xlabel('Epoch #')
  pyplot.ylabel('Success rate (%)')

  pyplot.plot(range(1, len(rates)+1), rates, 'r-')

  pyplot.draw()

Note that I am also calling pyplot.ion() at the start of the program.

This *mostly* works. However, I run into a strange issue. If the figure
window is minimized/hidden, when I open it up, nothing shows up in it (the
content is only grey). The plot will appear only if the window is
maximized/visible when the plotting occurs. If I again minimize the window
after the plot was drawn, it goes back to being gray.