Skip to content

Logging interactive visualizations#

Neptune can render Matplotlib, Altair, Bokeh, and Plotly outputs as interactive visualizations.

You can also log and display HTML files interactively (see Logging HTML).

See examples in Neptune 

Logging Matplotlib figures#

By default, Neptune logs Matplotlib figures as static images.

You can use File.as_html() to log the figure as an interactive visualization instead.

from neptune.new.types import File

fig = ...
run["visuals/matplotlib-fig"].upload(File.as_html(fig))

See in Neptune 

For a more detailed example, see Working with Matplotlib.

Plotly incompatibility

Plotly is not compatible with the latest Matplotlib (3.5.0+) due to the fact that mpl_to_plotly() uses deprecated Matplotlib functionalities.

To use Plotly together with Matplotlib, you may need to downgrade Matplotlib to version 3.2 or upgrade Plotly to 5.0+. For more information, see Plotly issue 1568 and issue 3624 on GitHub.

Logging Altair, Bokeh, and Plotly figures#

You can upload figures from these graphing libraries as any other file:

fig = ...  # Altair chart
run["visuals/altair-fig"].upload(fig)

For a more detailed example, see Working with Altair.

fig = ...  # Bokeh chart
run["visuals/bokeh-fig"].upload(fig)

For a more detailed example, see Working with Bokeh.

fig = ...  # Plotly chart
run["visuals/plotly-fig"].upload(fig)

Example of how to log a 3D point cloud created using Plotly to Neptune: Open Neptune app ≫

For a more detailed example, see Working with Plotly.