Skip to main content

Show sparsity pattern of sparse matrices

Project description


CircleCI codecov Codacy grade 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.write_png('out1.png', A, border_width=2)
betterspy.write_png('out2.png', A, border_width=2, colormap='viridis')
no colormap viridis


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

pip install -U betterspy

to install or upgrade. Use sudo -H to install as root or the --user option of pip to install in $HOME.


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



To create a new release

  1. bump the __version__ number,

  2. publish to PyPi and tag on GitHub:

    $ make publish


betterspy is published under the MIT license.

Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
betterspy-0.1.1-py2.py3-none-any.whl (4.4 kB) Copy SHA256 hash SHA256 Wheel py2.py3
betterspy-0.1.1.tar.gz (4.4 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page