Skip to content

Log interactive charts and visualizations#

You can log plots and charts, such as Matplotlib, Altair, Bokeh, and Plotly figures, as HTML objects and render them as interactive visualizations.

Generic recipe
run = neptune.init_run()

fig = ...  # figure object
run["visuals/my-figure"] = fig

To view the figure in Neptune, navigate to All metadata, or create a custom dashboard with a File preview widget.

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.types import File

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

See in Neptune 

For a more detailed example, see Matplotlib integration guide.

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"] = fig

For a more detailed example, see Altair integration guide.

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

For a more detailed example, see Bokeh integration guide.

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

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

For a more detailed example, see Plotly integration guide.

Logging Leaflet maps#

Using the Folium library, you can log interactive maps to Neptune by saving them as HTML first.

import folium
import neptune

m = folium.Map()
m.save("map.html")

run = neptune.init_run()
run["leaflet_map"].upload("map.html")

The above example logs the created map as a File field named leaflet_map.

To display it in Neptune, select the run where the map was logged and navigate to All metadata, or create a custom dashboard with a File preview widget.

See in Neptune