def plot_mat(self, mat, fn): plt.matshow(asarray(mat.todense())) plt.axis('equal') sh = mat.shape plt.gca().set_yticks(range(0, sh[0])) plt.gca().set_xticks(range(0, sh[1])) plt.grid('on') plt.colorbar() plt.savefig(join(self.outs_dir, fn)) plt.close()
def plot_mat(self, mat, fn): plt.matshow(asarray(mat.todense())) plt.axis('equal') sh = mat.shape plt.gca().set_yticks(range(0,sh[0])) plt.gca().set_xticks(range(0,sh[1])) plt.grid('on') plt.colorbar() plt.savefig(join(self.outs_dir, fn)) plt.close()
def test1(self): file_G = join(self.share_dir, 'G0_He50km_VisM6.3E18_Rake83.h5') G = vj.inv.ep.EpochGNoRaslip(file_G, mask_sites=['J550']) out = G.get_data_at_epoch(0) stacked = G.stack([0, 60, 120]) plt.matshow(abs(stacked) * 100, aspect=5) # plt.show() plt.close()
def test1(self): file_G = join(self.share_dir,'G0_He50km_VisM6.3E18_Rake83.h5') G = vj.inv.ep.EpochGNoRaslip(file_G, mask_sites= ['J550'] ) out = G.get_data_at_epoch(0) stacked = G.stack([0,60,120]) plt.matshow(abs(stacked)*100, aspect=5) # plt.show() plt.close()
def plot_convictions(self): # plt.figure() plt.matshow(self.get_matrix_of_agents_convictions()) plt.colorbar() plt.clim(-1, 1) # Sets the min/max limits of colorbar plt.title("Convictions")
def plot_culture(self): # plt.figure() plt.matshow(self.get_matrix_of_agents_culture()) plt.colorbar() plt.clim(0, 1) # Sets the min/max limits of colorbar plt.title("Culture")
from sigfeat import Extractor from sigfeat.feature import MFCC extmfcc = Extractor(MFCC()) if __name__ == '__main__': from pylab import plt, np from sigfeat.source.soundfile import SoundFileSource from sigfeat.preprocess import MeanMix from sigfeat.sink import DefaultDictSink src = MeanMix(SoundFileSource('Test.wav', blocksize=4096, overlap=2048)) sink = DefaultDictSink() extmfcc.extract(src, sink) plt.matshow(np.array(sink['results']['MFCC']).T) plt.axis('tight') plt.show()