SkillAgentSearch skills...

Betterspy

:eyes: Visualization for SciPy sparse matrices.

Install / Use

/learn @nschloe/Betterspy
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

betterspy

PyPi Version PyPI pyversions GitHub stars PyPi downloads

Discord

gh-actions codecov LGTM Code style: black

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

Example:

import betterspy
from scipy import sparse

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

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

betterspy.show(A)

betterspy.write_png(
    "out.png",
    A,
    # border_width=2,
    # border_color="red",
    # colormap="viridis"
)

<img src="https://nschloe.github.io/betterspy/plain.png"> | <img src="https://nschloe.github.io/betterspy/viridis.png"> :-------------------:|:------------------:| no colormap | viridis |

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

betterspy msc00726.mtx [out.png]

See betterspy -h for all options.

Gallery

<img src="https://nschloe.github.io/betterspy/bp_200.mtx.png" width="70%"> | <img src="https://nschloe.github.io/betterspy/bp_600.mtx.png" width="70%"> | <img src="https://nschloe.github.io/betterspy/Chebyshev2.mtx.png" width="70%"> :---------:|:------------:|:---------------:| bp_200 | bp_600 | Chebyshev2 |

<img src="https://nschloe.github.io/betterspy/orani678.mtx.png" width="70%"> | <img src="https://nschloe.github.io/betterspy/rajat19.mtx.png" width="70%"> | <img src="https://nschloe.github.io/betterspy/rdb1250l.mtx.png" width="70%"> :---------:|:------------:|:---------------:| orani678 | rajat19 | rdb1250l |

<img src="https://nschloe.github.io/betterspy/rdb3200l.mtx.png" width="70%"> | <img src="https://nschloe.github.io/betterspy/west0989.mtx.png" width="70%"> | <img src="https://nschloe.github.io/betterspy/west1505.mtx.png" width="70%"> :---------:|:------------:|:---------------:| rdb3200l | west0989 | west1505 |

Installation

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

pip install betterspy

to install.

License

This software is published under the GPLv3 license.

Related Skills

View on GitHub
GitHub Stars42
CategoryDevelopment
Updated9mo ago
Forks7

Languages

Python

Security Score

87/100

Audited on Jun 11, 2025

No findings