flex_subtitle = "built using jupyter-flex"
flex_external_link = "https://github.com/danielfrg/jupyter-flex/blob/master/examples/plots/altair-single.ipynb"
flex_title = "Altair single"
flex_show_source = True
import altair as alt
from vega_datasets import data
alt.renderers.set_embed_options(actions=False)
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
plot.properties(
width='container',
height='container'
).interactive()