diff scripts/ABSapprox.py @ 34:e8c4672e9de4

Save algonames (not tested) in output mat file Matplotlib saves tight images (bbox_inches = 'tight') utils.py: added loadsavematrices, modified loadshowmatrices
author nikcleju
date Tue, 15 Nov 2011 14:50:58 +0000
parents 116dcfacd1cc
children d4f9c906dc78
line wrap: on
line diff
--- a/scripts/ABSapprox.py	Fri Nov 11 16:12:17 2011 +0000
+++ b/scripts/ABSapprox.py	Tue Nov 15 14:50:58 2011 +0000
@@ -307,6 +307,7 @@
     tosave['numvects'] = numvects
     tosave['SNRdb'] = SNRdb
     tosave['lambdas'] = lambdas
+    tosave['algonames'] = [algotuple[1] for algotuple in algosN+algosL]
     try:
       scipy.io.savemat(savedataname, tosave)
     except:
@@ -319,7 +320,7 @@
       plt.imshow(meanmatrix[algoname], cmap=cm.gray, interpolation='nearest',origin='lower')
       if dosaveplot:
         for ext in saveplotexts:
-          plt.savefig(saveplotbase + algoname + '.' + ext)
+          plt.savefig(saveplotbase + algoname + '.' + ext, bbox_inches='tight')
     for algotuple in algosL:
       algoname = algotuple[1]
       for ilbd in np.arange(lambdas.size):
@@ -327,7 +328,7 @@
         plt.imshow(meanmatrix[algoname][ilbd], cmap=cm.gray, interpolation='nearest',origin='lower')
         if dosaveplot:
           for ext in saveplotexts:
-            plt.savefig(saveplotbase + algoname + ('_lbd%.0e' % lambdas[ilbd]) + '.' + ext)
+            plt.savefig(saveplotbase + algoname + ('_lbd%.0e' % lambdas[ilbd]) + '.' + ext, bbox_inches='tight')
     if doshowplot:
       plt.show()