Interactive plots: plotly#
The use of the plotly package is an example which allows you to create HTML/Javascript widgets from python code without any knowledge on HTML/Javascript.
The example below is taken from the FEM-module by Frans van der Meer. When using Plotly graphs, make sure the notebook is executed in Jupyter Lab / Jupyter Notebook for the figures to be shown in the book. Running the code in VS code might break the result in the book, although the output is visible in VS code. Alternatively, add the following lines of code to your notebook to have a valid output in the book as well:
import plotly.io as pio
pio.renderers.default = 'notebook'