Python matplotlib.pyplot 模块,spy() 实例源码

我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用matplotlib.pyplot.spy()

项目:discretize    作者:simpeg    | 项目源码 | 文件源码
def getError(self):
        if plotIt:
            plt.spy(self.getAve(self.M))
            plt.show()

        num = self.getAve(self.M) * self.getHere(self.M)
        err = np.linalg.norm((self.getThere(self.M)-num), np.inf)

        if plotIt:
            self.M.plotImage(self.getThere(self.M)-num)
            plt.show()
            plt.tight_layout

        return err
项目:discretize    作者:simpeg    | 项目源码 | 文件源码
def getError(self):
        if plotIt:
            plt.spy(self.getAve(self.M))
            plt.show()

        num = self.getAve(self.M) * self.getHere(self.M)
        err = np.linalg.norm((self.getThere(self.M)-num), np.inf)
        return err
项目:DCN    作者:alexnowakvila    | 项目源码 | 文件源码
def plot_Phis_sparsity(self, Phis, fig=0):
        Phis = [phis[0].data.cpu().numpy() for phis in Phis]
        plt.figure(fig)
        plt.clf()
        for i, phi in enumerate(Phis):
            plt.subplot(1, len(Phis), i + 1)
            # plot first element of the batch
            plt.spy(phi, precision=0.001, marker='o', markersize=2)
            plt.xticks([])
            plt.yticks([])
            plt.title('k={}'.format(i))
        path = os.path.join(self.path, 'Phis.png')
        plt.savefig(path)
项目:DCN    作者:alexnowakvila    | 项目源码 | 文件源码
def plot_Phis_sparsity(self, Phis, fig=0):
        Phis = [phis[0].data.cpu().numpy() for phis in Phis]
        plt.figure(fig)
        plt.clf()
        for i, phi in enumerate(Phis):
            plt.subplot(1, len(Phis), i + 1)
            # plot first element of the batch
            plt.spy(phi, precision=0.001, marker='o', markersize=2)
            plt.xticks([])
            plt.yticks([])
            plt.title('k={}'.format(i))
        path = os.path.join(self.path, 'Phis.png')
        plt.savefig(path)
项目:DCN    作者:alexnowakvila    | 项目源码 | 文件源码
def plot_Phis_sparsity(self, Phis, fig=0):
        Phis = [phis[0].data.cpu().numpy() for phis in Phis]
        plt.figure(fig)
        plt.clf()
        for i, phi in enumerate(Phis):
            plt.subplot(1, len(Phis), i + 1)
            # plot first element of the batch
            plt.spy(phi, precision=0.001, marker='o', markersize=2)
            plt.xticks([])
            plt.yticks([])
            plt.title('k={}'.format(i))
        path = os.path.join(self.path, 'Phis.png')
        plt.savefig(path)