#!/usr/bin/env python # coding: utf-8 # In[ ]: flex_title = "Altair" flex_source_code = "https://github.com/danielfrg/jupyter-flex/blob/master/examples/plots/altair-simple.ipynb" # In[ ]: import altair as alt from vega_datasets import data # In[ ]: alt.renderers.set_embed_options(actions=False) # In[ ]: source = data.cars() plot = alt.Chart(source).mark_circle(size=60).encode( x='Horsepower', y='Miles_per_Gallon', color='Origin', tooltip=['Name', 'Origin', 'Horsepower', 'Miles_per_Gallon'] ) plot # In[ ]: plot.properties( width='container', height='container' ).interactive()