Python matplotlib.pyplot.spy() Examples

The following are 2 code examples for showing how to use matplotlib.pyplot.spy(). These examples are extracted from open source projects. 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 want to check out the right sidebar which shows the related API usage.

You may also want to check out all available functions/classes of the module matplotlib.pyplot , or try the search function .

Example 1
Project: pyscf   Author: pyscf   File: prod_basis.py    License: 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 
Example 2
Project: florence   Author: romeric   File: LinearSolver.py    License: MIT License 5 votes vote down vote up
def SparsityPattern(self,A):
        import matplotlib.pyplot as plt
        plt.spy(A)
        plt.grid('on')
        plt.show()