← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3602: Fix MatplotlibDeprecationWarning: The use of 0

 

------------------------------------------------------------
revno: 3602
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Mon 2015-03-02 15:54:02 +0100
message:
  Fix MatplotlibDeprecationWarning: The use of 0
  
  New matplotlib warns about not using null-values in
  subplot-command.
modified:
  py/plot.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/plot.py'
--- py/plot.py	2013-03-19 18:28:10 +0000
+++ py/plot.py	2015-03-02 14:54:02 +0000
@@ -381,7 +381,7 @@
 	for nPlot,p in enumerate(plots.keys()):
 		pStrip=p.strip().split('=',1)[0]
 		if not subPlots: pylab.figure()
-		else: pylab.subplot(subRows,subCols,nPlot)
+		else: pylab.subplot(subRows,subCols,nPlot+1)
 		if plots[p]==None: # image plot
 			if not pStrip in imgData.keys(): imgData[pStrip]=[]
 			# fake (empty) image if no data yet
@@ -670,7 +670,7 @@
 		pStrip=p.strip().split('=',1)[0]
 		if plots[p]==None: continue # image plots, which is not exported
 		if len(plots)==1: py.write('pylab.figure()\n')
-		else: py.write('pylab.subplot(%d,%d,%d)\n'%(subRows,subCols,nPlots))
+		else: py.write('pylab.subplot(%d,%d,%d)\n'%(subRows,subCols,nPlots+1))
 
 def _mkTimestamp():
 	import time