https://github.com/nschloe/betterspy
:eyes: Visualization for SciPy sparse matrices.
https://github.com/nschloe/betterspy
mathematics matrix pypi python sparse-matrices sparse-matrix visualization
Last synced: 5 days ago
JSON representation
:eyes: Visualization for SciPy sparse matrices.
- Host: GitHub
- URL: https://github.com/nschloe/betterspy
- Owner: nschloe
- License: gpl-3.0
- Created: 2013-11-12T15:51:46.000Z (over 11 years ago)
- Default Branch: main
- Last Pushed: 2021-05-26T15:58:08.000Z (about 4 years ago)
- Last Synced: 2025-06-01T13:13:09.344Z (23 days ago)
- Topics: mathematics, matrix, pypi, python, sparse-matrices, sparse-matrix, visualization
- Language: Python
- Homepage:
- Size: 1.15 MB
- Stars: 41
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# betterspy
[](https://pypi.org/project/betterspy)
[](https://pypi.org/pypi/betterspy/)
[](https://github.com/nschloe/betterspy)
[](https://pypistats.org/packages/betterspy)[](https://discord.gg/hnTJ5MRX2Y)
[](https://github.com/nschloe/betterspy/actions?query=workflow%3Aci)
[](https://codecov.io/gh/nschloe/betterspy)
[](https://lgtm.com/projects/g/nschloe/betterspy)
[](https://github.com/psf/black)Show sparsity patterns of sparse matrices or write them to image files.
Example:
```python
import betterspy
from scipy import sparseA = sparse.rand(20, 20, density=0.1)
# betterspy.plot()
# set attributes on gca()
# plt.show()
# or directlybetterspy.show(A)
betterspy.write_png(
"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](https://math.nist.gov/MatrixMarket/) or
[Harwell-Boeing](https://en.wikipedia.org/wiki/Harwell-Boeing_file_format) files:
```
betterspy msc00726.mtx [out.png]
```
See `betterspy -h` for all options.### Gallery
|
|
![]()
:---------:|:------------:|:---------------:|
`bp_200` | `bp_600` | `Chebyshev2` |
|
|
![]()
:---------:|:------------:|:---------------:|
`orani678` | `rajat19` | `rdb1250l` |
|
|
![]()
:---------:|:------------:|:---------------:|
`rdb3200l` | `west0989` | `west1505` |### Installation
betterspy is [available from the Python Package
Index](https://pypi.org/project/betterspy/), so simply do
```
pip install betterspy
```
to install.### License
This software is published under the [GPLv3 license](https://www.gnu.org/licenses/gpl-3.0.en.html).