Python matplotlib.pyplot.spy() Examples

The following are 2 code examples of matplotlib.pyplot.spy(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module matplotlib.pyplot , or try the search function .
Example #1
Source File: LinearSolver.py    From florence with MIT License 6 votes vote down vote up
def SparsityPattern(self,A):
        import matplotlib.pyplot as plt
        plt.spy(A)
        plt.grid('on')
        plt.show() 
Example #2
Source File: prod_basis.py    From pyscf with Apache License 2.0 5 votes vote down vote up
def generate_png_spy_dp_vertex(self):
    """Produces pictures of the dominant product vertex in a common black-and-white way"""
    import matplotlib.pyplot as plt
    plt.ioff()
    dab2v = self.get_dp_vertex_doubly_sparse()
    for i,ab2v in enumerate(dab2v): 
      plt.spy(ab2v.toarray())
      fname = "spy-v-{:06d}.png".format(i)
      print(fname)
      plt.savefig(fname, bbox_inches='tight')
      plt.close()
    return 0