Skip to main content

Show sparsity patterns of sparse matrices

Project description


CircleCI codecov Code style: black PyPI pyversions PyPi Version GitHub stars

Show sparsity patterns of sparse matrices or write them to image files.


import betterspy

A = sparse.rand(20, 20, density=0.1)

# betterspy.plot()
# set attributes on gca()
# or directly

    "out.png", A,
    # border_width=2,
    # border_color="red",
    # colormap="viridis"
no colormap viridis

There is a command-line tool that can be used to show matrix-market files:

betterspy msc00726.mtx [out.png]

See betterspy -h for all options.


betterspy is available from the Python Package Index, so simply do

pip install betterspy

to install.


To run the betterspy unit tests, check out this repository and type



This software is published under the GPLv3 license.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for betterspy, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size betterspy-0.1.4-py3-none-any.whl (17.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size betterspy-0.1.4.tar.gz (17.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page