import altair as alt
from vega_datasets import data
iris = data.iris()
chart = alt.Chart(iris).mark_point().encode(
x='petalLength',
y='petalWidth',
color='species'
)
chart.display()
chart.save('output/example_chart.html')
The following requires the selenium
Python package and the chromedriver
executable to be installed.
chart.save('output/example_chart.svg')
chart.serve()
Note: if you're in the Jupyter notebook, Chart.serve() is not the best way to view plots. Consider using Chart.display(). You must interrupt the kernel to cancel this command. Serving to http://127.0.0.1:8891/ [Ctrl-C to exit]
127.0.0.1 - - [23/Oct/2019 22:24:24] "GET / HTTP/1.1" 200 -
stopping Server...