Skip to main content

bsplot Sagittal volume animation Surface rotation animation

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]".

alt text

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

  • matplotlib
  • nibabel
  • scipy
  • templateflow
  • scikit-image
  • nilearn — optional, only for project_vol_to_surf and cortical flatmaps (pip install "bsplot[projection]")

Metadata

Release files for bsplot 0.0.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bsplot 0.0.13
File Size Uploaded Provenance Actions
bsplot-0.0.13.tar.gz 6.2 MB With provenance Details for bsplot-0.0.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bsplot 0.0.13
File Interpreter ABI Platform Actions
bsplot-0.0.13-py3-none-any.whl Python 3 none any Details for bsplot-0.0.13-py3-none-any.whl

Total release size: 12.5 MB

Release files / bsplot-0.0.13.tar.gz

Download URL bsplot-0.0.13.tar.gz
Size 6.2 MB
Tags Source
SHA-256 checksum
How to use checksums
68f2be4274822c70e32b0372be94fb44081e5b93d2f2be19d89e1469e8718f64
BLAKE2b-256 checksum
How to use checksums
42971134343e2a5390ec14e2a3a233fe6f709ab1470ee7ba119f1d18617417eb
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 Nov 16, 2026.

Transparency log

Release files / bsplot-0.0.13-py3-none-any.whl

Download URL bsplot-0.0.13-py3-none-any.whl
Size 6.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
1a8004b7d042a0fd0ec5e7fc3c01df957f9c29ba38260a5a32f0d0ee42e260d4
BLAKE2b-256 checksum
How to use checksums
52030d6430f6e9a5fef8e5f1fb21d9c713568d4ef3cdfb1f87ee2dc29445ce5e
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 Nov 16, 2026.

Transparency log

Security for bsplot 0.0.13

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bsplot-0.0.13.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 Nov 16, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page