On 03/02/2012 01:16 AM, Jean-Baptiste Marquette wrote: > > Hi Ben, > >> You have several possible sources of problems here. I would first make >> sure that basic matplotlib scripts work using the Qt4Agg backend on >> your computer. Test out some regular scripts from the examples section >> of the documentation. If they work as expected, then it is probably >> more likely that there is a problem with one of the other libraries. > > Good point. Tests successful. > >> Another possible source of trouble may lie with the calls to "sleep". >> Because the display libraries are not on a separate process, the sleep >> could also prevent the figures from being completely rendered. >> >> Personally, I wouldn't even bother with the interactive mode. Keep it >> off, and just put the cleanup code after "plt.show()", which is a >> blocking call. There is no need to implement your own event loop. > > The challenge is to display hundreds of stellar light curves by > sequently selecting rows in a table through the SAMP mechanism. Thus it > would be fine not to have to kill the plot window after each display, > but to have it automatically refreshed after each row selection (I'm a > lazy guy…). > I just commented the plt.ion() line, this yields a segmentation fault, > here is the crash report.
This appears to be very much a dueling event loop problem. My guess is that the solution will have to be something that keeps the event loops well separated, probably in separate processes. All interaction with your Client event loop would be in one process, and the callback would get your data and put it somewhere (e.g. in a numpy npz file). Then the trick is to have the matplotlib process in a polling loop using a timer (done crudely with plt.pause(0.1); there is probably a better way) checking to see if that "somewhere" has been updated, and if so, updating its plot. Eric > > Cheers > JB > ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users