bsplot
Neuroscience plotting utilities built on matplotlib.
Overview
- Brain surfaces and glass-brain visualizations
- Volume slicing with anatomical overlays
- Tractography rendering
- Publication-ready styles and scientific colormaps
- Panel helpers for multi-figure layouts
- Terminal (ASCII) surface backend — render a lit brain as text, with data overlays
Terminal (ASCII) rendering
Render a cortical surface straight to text — no matplotlib figure — as a lit
"surface of letters", with optional scalar overlays and parcellations in colour.
The default is the folded pial cortex, and the output adapts to wherever it
is drawn: terminal (ANSI colour), notebook/website (color_mode="html",
auto-selected in a notebook), or README/plain-text (color_mode="none").
import bsplot
bsplot.plot_surf_ascii() # pial template brain, lateral
bsplot.plot_surf_ascii(data=my_stat_map) # scalar overlay, colour-mapped
bsplot.plot_surf_ascii(parcellation=labels) # coloured regions
bsplot.plot_surf_ascii(width=140) # width = resolution knob
bsplot.plot_surf_ascii(background="light") # for a white background
bsplot-ascii # pial fsaverage, lateral (or: python -m bsplot.ascii)
bsplot-ascii --view top --hemi both # both hemispheres, dorsal
bsplot-ascii --html > brain.html # emit an HTML block
bsplot-ascii --sphere # offline demo (no download)
See the Terminal surface guide for ramps, colormaps, views, and resolution.
Timeseries — recordings and simulations
Surface colouring over time, cheap enough to stream live. The geometry is prepared once, so each frame only re-colours the visible faces: ~0.7 ms/frame (>1000 fps) against ~184 ms for a full render.
mov = bsplot.AsciiSurfaceMovie(data, hemi="lh", view="lateral", width=80)
mov.play(fps=20) # live in the terminal
mov.to_gif("sim.gif"); mov.to_html("sim.html"); mov.to_cast("sim.cast")
# region-level data (TVB-style) mapped onto the surface by an atlas
bsplot.AsciiSurfaceMovie(data, atlas="DesikanKilliany", region_labels=labels)
# straight from a tvbo simulation result
bsplot.AsciiSurfaceMovie.from_tvbo("exp-3_result.h5", atlas="dk").play()
bsplot-ascii-movie data.npy --atlas Destrieux --fps 20 # play
bsplot-ascii-movie result.h5 --tvbo -o sim.gif # or export
See the Timeseries guide.
Reading tvbo result files needs pip install "bsplot[tvbo]".
Installation
pip install bsplot
Two optional features — volume-to-surface projection (project_vol_to_surf)
and fsaverage cortical flatmaps (get_flat_surface_geometry) — additionally
need nilearn:
pip install "bsplot[projection]"
Dependencies
matplotlibnibabelscipytemplateflowscikit-imagenilearn— optional, only forproject_vol_to_surfand cortical flatmaps (pip install "bsplot[projection]")
Metadata
Release files for bsplot 0.0.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bsplot-0.0.12.tar.gz | 6.2 MB | With provenance | Details for bsplot-0.0.12.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bsplot-0.0.12-py3-none-any.whl | Python 3 | none | any | Details for bsplot-0.0.12-py3-none-any.whl |
Total release size: 12.5 MB
Release files / bsplot-0.0.12.tar.gz
| Download URL | bsplot-0.0.12.tar.gz |
|---|---|
| Size | 6.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1eaf7554b3cbafe9a114b12d2f5c053b0e7ba01395d4ba61c0f944b6846b14f8
|
|
BLAKE2b-256 checksum How to use checksums |
4ab67123f2788b69723ca75c630c96c1a3efb737677244ab39d925de8aef3125
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logRelease files / bsplot-0.0.12-py3-none-any.whl
| Download URL | bsplot-0.0.12-py3-none-any.whl |
|---|---|
| Size | 6.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
81b742090b7299baa97e8181aa6312c91772e9382bed324567f2d6ae999f641b
|
|
BLAKE2b-256 checksum How to use checksums |
7814c0d37e46ddea540cc8199f3fee203e21ea382460eb897e0e080a5c7838a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logSecurity for bsplot 0.0.12
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for bsplot-0.0.12.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.