My visualization library [1] is written in C and exposes a visualization API in C. It is packaged as a Python wheel using auto-generated ctypes bindings, which includes the shared library (so, dylib, or dll) and a few dependencies. This setup works very well, with no need to compile against each Python version. I only need to build it for the supported platforms, which is handled automatically by GitHub Actions. The library is designed to minimize the number of C calls, making the ctypes overhead negligible in practice.

[1] https://datoviz.org/

This looks awesome, thanks for sharing - do you have any info on how it compares to matplotlib in terms of plotting speed? (even just rough estimates)

A quick inspection of the article suggests there's a difference of intent.

<snip> Datoviz is a relatively low-level visualization library. It focuses on rendering visual primitives like points, lines, images, and meshes — efficiently and interactively.

Unlike libraries such as Matplotlib, Datoviz does not provide high-level plotting functions like plt.plot(), plt.scatter(), or plt.imshow(). Its goal is not to replace plotting libraries, but to serve as a powerful rendering backend for scientific graphics. </snip>

Yes, although there isn't much to do to go from Datoviz to simple scientific plots like scatter plots or polylines with axes. It's just a few lines of code. I should probably clarify the documentation.

Good idea, I should do benchmarks on simple plots. It's orders of magnitude faster. Above 60 FPS on hundreds of thousands to even millions of points depending on the type of plot, on common hardware.

Thanks, I expected as much but wanted to confirm before I commit to learning something new, not for laziness but for prioritising what to learn next. Project looks great either way!

I ran a quick benchmark comparing Matplotlib and Datoviz on a simple interactive 2D scatter plot. In short, Datoviz is 20 to 2000 times faster.

Screenshot: https://raw.githubusercontent.com/datoviz/data/master/screen...

Code: https://github.com/datoviz/datoviz/blob/dev/examples/benchma...

How does it compare to VTK, that also provides a Python API?

Datoviz is much lighter and younger than VTK. It compiles in seconds, making it much faster to build, and it's easier to install and distribute.

It has far fewer features since it focuses solely on rendering common primitives. For example, it doesn't handle data file loading, except for a few quick loaders like OBJ used mainly for testing.

There's almost no computational geometry, data processing, or signal processing functionality. Datoviz is solely focused on interactive rendering.

Datoviz also supports fast, high-quality 2D vector graphics, scaling efficiently to millions of points. In contrast, VTK is primarily designed for more complex and heavy 3D rendering tasks.