Skip to content

pyodide/matplotlib-pyodide

Repository files navigation

matplotlib-pyodide

PyPI Latest Release GHA codecov

HTML5 backends for Matplotlib compatible with Pyodide

This package includes two matplotlib backends,

  • the wasm_backend which from allows rendering the Agg buffer as static images into an HTML canvas
  • an interactive HTML5 canvas backend html5_canvas_backend described in this blog post

Installation

This package will be installed as a dependency when you load matplotlib in Pyodide.

Usage

To change the backend in matplotlib,

  • for the wasm backend,
    import matplotlib
    matplotlib.use("module://matplotlib_pyodide.wasm_backend")
  • for the interactive HTML5 backend;
    import matplotlib
    matplotlib.use("module://matplotlib_pyodide.html5_canvas_backend")

For more information see the matplotlib documentation.

License

pyodide-cli uses the Mozilla Public License Version 2.0.

About

HTML5 backends for Matplotlib compatible with Pyodide

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages