SciPy 2023

Ultra fast visualization of large datasets using modern graphics APIs in jupyter notebooks
07-14, 13:15–13:45 (America/Chicago), Zlotnik Ballroom

Fast interactive visualization remains a considerable barrier in analyses pipelines for large neuronal datasets. Here, we present fastplotlib, a scientific plotting library featuring an expressive API for very fast visualization of scientific data. Fastplotlib is built upon pygfx which utilizes the GPU via WGPU, allowing it to interface with modern graphics APIs such as Vulkan for fast rendering of objects. Fastplotlib is non-blocking, allowing for interactivity with data after plot generation. Ultimately, fastplotlib is a general purpose scientific plotting library that is useful for the fast and live visualization and analysis of complex datasets.


Over the past decade, advanced analyses pipelines have been developed for large neuronal datasets [1][2]. However, fast visualization and live interactivity during data collection is largely unsupported. While current tools within the Python plotting ecosystem (ex. pyqtgraph, VisPy, napari) allow for interactive data visualization, they either fail to leverage modern GPUs efficiently, lack intuitive APIs for rapid prototyping, or require users to write their own shaders. Additionally, other popular plotting libraries, such as bokeh and matplotlib, are not geared towards fast interactive visualization with millions of objects. Given these challenges with current visualization tools, the need for a modern GPU-driven interactive plotting library exists. In this presentation, we will go through the technical details, as well as a brief demo on how fastplotlib makes fast interactive visualization of complex neuronal datasets possible. We will also demonstrate the broader applicability of fastplotlib as a fast, general-purpose plotting library.

Fastplotlib is built on top of pygfx which is a cutting edge Python rendering engine that utilizes Vulkan, which can efficiently leverage modern GPU and CPU hardware. Vulkan, released in 2016, is the successor to OpenGL and features a low overhead with respect to the amount of code per-draw-per-object allowing for speed even when rendering millions of objects. Pygfx is also non-blocking, which allows for interactivity and modification of already drawn objects. Fastplotlib utilizes the pygfx rendering library for fast visualization with an expressive API for scientific visualization. The benefits of fastplotlib are that it reduces boilerplate code which allows users to focus on their data without having to manage the underlying rendering process. Additionally, fastplotlib allows for animations as well as high-level interactivity among plots, which can be combined with lazy loading of very large neuronal imaging movies that are hundreds of gigabytes or terabytes in size. Furthermore, fastplotlib can be used in jupyter notebooks, allowing it to be used on cloud computing and other remote infrastructures. In total, these unique features and the underlying architecture create a plotting library that is fast, easy to use, and multifaceted.

Initially, fastplotlib was developed for use in the neuroscience community to aid in the analysis of large neuronal datasets. However, the long term goal of this project is to provide an open source software that serves as a general-purpose scientific plotting library. As we are currently in the early stages of development, we are looking for community involvement and to connect with other developers to further progress our software package.

https://github.com/kushalkolar/fastplotlib

I am a current undergraduate student at the University of North Carolina at Chapel Hill studying Computer Science and Statistics. I currently work for the Hantman Lab in the UNC Neuroscience Center helping to develop tools to aid in the analysis and visualization of large calcium imaging datasets.