← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3703: Add of pylab.ion() in plotNumInteractionsHistogram() and plotDirections() so that yade does not h...

 

------------------------------------------------------------
revno: 3703
committer: Jerome Duriez <jerome.duriez@xxxxxxxxxxxxxxx>
timestamp: Mon 2013-10-07 11:10:44 +0200
message:
  Add of pylab.ion() in plotNumInteractionsHistogram() and plotDirections() so that yade does not hang anymore after launch of these functions (even after closing the plot window, here). Still thanks to Vaclav ! (http://stackoverflow.com/questions/9753885/pylab-matplotlib-show-waits-until-window-closes)
modified:
  py/utils.py


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'py/utils.py'
--- py/utils.py	2013-10-04 12:04:43 +0000
+++ py/utils.py	2013-10-07 09:10:44 +0000
@@ -497,6 +497,7 @@
 	pylab.title('Number of interactions histogram, average %g (cutoff=%g)'%(avgNumInteractions(cutoff),cutoff))
 	pylab.xlabel('Number of interactions')
 	pylab.ylabel('Body count')
+	pylab.ion()
 	pylab.show()
 
 def plotDirections(aabb=(),mask=0,bins=20,numHist=True,noShow=False):
@@ -524,7 +525,9 @@
 		pylab.axvline(x=avg,linewidth=3,color='r')
 		pylab.ylabel('Body count')
 	if noShow: return pylab.gcf()
-	else: pylab.show()
+	else:
+		pylab.ion()
+		pylab.show()
 
 
 def encodeVideoFromFrames(*args,**kw):