Ejemplo n.º 1
0
    def showFilters(self):
        W = self.dca.getVarValue('W')

        #figure(self.Wfig)
        #clf()
        #title('W')
        #imshow(W, interpolation="nearest", cmap = cm.jet)
        #colorbar()
        #draw()

        figure(self.Cytfig)
        Cyt = self.dca.getVarValue('Cyt')
        l = len(Cyt)
        diagvals = []
        offdiagvals = []
        for i in xrange(l):            
            for j in xrange(i):
                offdiagvals.append(Cyt[i,j])
            diagvals.append(Cyt[i,i])

        clf()
        subplot(1,3,1)
        title('Cyt')
        imshow(Cyt, interpolation="nearest", cmap = cm.gray)
        colorbar()

        subplot(1,3,2)
        title('Cyt diagonal values histogram')
        hist(diagvals)
        
        subplot(1,3,3)
        title('Cyt off-diagonal values histogram')
        hist(offdiagvals)

        draw()
        
        #figure(self.Cxfig)
        #clf()
        #title('Cx')
        #imshow(self.dca.getVarValue('Cx'), interpolation="nearest", cmap = cm.jet)
        #colorbar()
        #draw()

        figure(self.filterfig)
        clf()
        plotRowsAsImages(W, 
                         img_height = self.img_height,
                         img_width = self.img_width,
                         nrows=5, ncols=10,
                         figtitle="filters",
                         show_colorbar=False, disable_ticks=True, colormap = cm.gray,
                         luminance_scale_mode = 0, vmin=None, vmax=None)        
        draw()
Ejemplo n.º 2
0
 def draw(self):
     # print "Start plotting..."
     mpl.clf()
     endidx = min(self.startidx + self.nrows * self.ncols, len(self.X))
     title = self.figtitle + " (" + str(
         self.startidx) + " ... " + str(endidx - 1) + ")"
     plotRowsAsImages(self.X[self.startidx:endidx],
                      img_height=self.img_height,
                      img_width=self.img_width,
                      nrows=self.nrows,
                      ncols=self.ncols,
                      figtitle=title,
                      luminance_scale_mode=self.luminance_scale_mode,
                      show_colorbar=self.show_colorbar,
                      disable_ticks=self.disable_ticks,
                      colormap=self.colormaps[self.cmapchoice],
                      vmin=self.vmin,
                      vmax=self.vmax,
                      transpose_img=self.transpose_img)
     # print "Plotted,"
     mpl.draw()
Ejemplo n.º 3
0
 def draw(self):
     # print "Start plotting..."
     mpl.clf()
     endidx = min(self.startidx+self.nrows*self.ncols, len(self.X))        
     title = self.figtitle+" ("+str(self.startidx)+" ... "+str(endidx-1)+")"
     plotRowsAsImages(self.X[self.startidx : endidx],
                      img_height = self.img_height,
                      img_width = self.img_width,
                      nrows = self.nrows,
                      ncols = self.ncols,
                      figtitle = title,
                      luminance_scale_mode = self.luminance_scale_mode,
                      show_colorbar = self.show_colorbar,
                      disable_ticks = self.disable_ticks,
                      colormap = self.colormaps[self.cmapchoice],
                      vmin = self.vmin,
                      vmax = self.vmax,
                      transpose_img = self.transpose_img
                      )
     # print "Plotted,"
     mpl.draw()