Installation | GPU Drivers | Examples
A fast plotting library built using the pygfx
render engine utilizing Vulkan via WGPU, so it is very fast! fastplotlib
is focussed on very fast interactive plotting in the notebook using an expressive API. It also works within desktop applications using glfw
or Qt
.
fastplotlib
is currently in the early alpha stage with breaking changes every ~week, but you're welcome to try it out or contribute! See our Roadmap for 2023.
Documentation: http://fastplotlib.readthedocs.io/
The docs are not entirely thorough, we recommend the example notebooks to get started.
Questions, ideas? Post an issue or chat on gitter.
See the examples directory. Start out with simple.ipynb
.
neuroscience_usecase.mp4
from fastplotlib import Plot
import numpy as np
plot = Plot()
data = np.random.rand(512, 512)
plot.add_image(data=data)
plot.show()
from fastplotlib import Plot
import numpy as np
plot = Plot()
data = np.random.rand(512, 512)
image = plot.image(data=data)
def update_data():
new_data = np.random.rand(512, 512)
image.data = new_data
plot.add_animations(update_data)
plot.show()
This is all in the notebook and non-blocking!
Interactive visualization of large imaging datasets in the notebook.
Install using pip
.
pip install fastplotlib
Installing simplejpeg
is recommended for faster plotting in notebooks using remote frame buffer. You will need C compilers to install it:
pip install simplejpeg
Clone or download the repo to try the examples
# clone the repo
git clone https://github.com/kushalkolar/fastplotlib.git
# cd into examples and launch jupyter lab
cd fastplotlib/examples
jupyter lab
Note: fastplotlib
and pygfx
are fast evolving projects, the version available through pip might be outdated, you will need to follow the "For Development" instructions below if you want the latest features. You can find the release history on pypi here: https://pypi.org/project/fastplotlib/#history
git clone https://github.com/kushalkolar/fastplotlib.git
cd fastplotlib
pip install -r requirements.txt
pip install -e .
# try the examples
cd examples
jupyter lab
You will need a GPU that supports Vulkan (integrated GPUs in CPUs are usually fine). Generally if your GPU is from 2017 or later it should support Vulkan.
For more information see: https://github.com/pygfx/wgpu-py#platform-requirements
Vulkan should be installed by default on Windows 11, but you will need to install your GPU manufacturer's driver package (Nvidia or AMD). If you have an integrated GPU within your CPU, you might still need to install a driver package too, check your CPU manufacturer's info. We recommend installing C compilers so that you can install simplejpeg
which improves remote frame buffer performance in notebooks.
Debian based distros:
sudo apt install mesa-vulkan-drivers
# for better performance with the remote frame buffer install libjpeg-turbo
sudo apt install libjpeg-turbo
For other distros install the appropriate vulkan driver package, and optionally the corresponding libjpeg-turbo
package for better remote-frame-buffer performance in jupyter notebooks.
As far as I know, WGPU uses Metal instead of Vulkan on Mac. I think you will need at least Mac OSX 10.13.
https://www.youtube.com/embed/-_0Gp_EqepI
fpl_fast_image_updates.mp4
https://user-images.githubusercontent.com/9403332/165677576-a0aa2d0f-a201-4e0e-91bd-aed800f775ee.mp4