Python and Matplotlib

In this example we will show you how to integrate our Python code for generating Matplotlib figures into the Python Code block and use the Image Box block to display it.

It is important to keep in mind that the runtime is not CPython but rather Pyodide that behaves slightly different. For this use case please pay attention at the following points (see the code below):

  • use the Agg backend which works fine with inseri-core (please see line 5)
  • save the figure a a PNG file

The PNG file is the output of our Python Code block, and used further as an input in the Image Box block.

is loading …
is loading …
is loading …
is loading …

First Published

in

Last Updated

Comments

Leave a Reply