Example: Embedding Altair & Hvplot Charts

This post will show examples of embedding interactive charts produced using Altair and Hvplot.

Altair Example

Below is a chart of the incidence of measles since 1928 for the 50 US states.

This was produced using Altair and embedded in this static web page. Note that you can also display Python code on this page:

import altair as alt
alt.renderers.enable('notebook')

HvPlot Example

Lastly, the measles incidence produced using the HvPlot package:

Notes

Important: When embedding charts, you will likely need to adjust the width/height of the charts before embedding them in the page so they fit nicely when embedded.