view scripts/utils.py @ 30:5f46ff51c7ff

Added console output detailing parameters Prepared for complete run 10.11.2011
author nikcleju
date Thu, 10 Nov 2011 22:43:11 +0000
parents 1a88766113a9
children e8c4672e9de4
line wrap: on
line source
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 09 12:28:55 2011

@author: ncleju
"""

import scipy.io
import matplotlib.pyplot as plt
import matplotlib.cm as cm

def loadshowmatrices(filename, algostr = ('GAP','SL0_approx')):
    mdict = scipy.io.loadmat(filename)
    for strname in algostr:
        print strname
        if mdict['meanmatrix'][strname][0,0].ndim == 2:
            plt.figure()
            plt.imshow(mdict['meanmatrix'][strname][0,0], cmap=cm.gray, interpolation='nearest',origin='lower')            
        elif mdict['meanmatrix'][strname][0,0].ndim == 3:
            for matrix in mdict['meanmatrix'][strname][0,0]:
                plt.figure()
                plt.imshow(matrix, cmap=cm.gray, interpolation='nearest',origin='lower')
    plt.show()
    print "Finished."