使用altair包时,我注意到创建图表时会生成图例。以下是代码:
import altair as alt
from vega_datasets import data
alt.renderers.enable('notebook')
cars = data.cars()
alt.Chart(cars).mark_circle().encode(x='Horsepower',
y='Miles_per_Gallon',
color='Origin',
tooltip=['Name', 'Origin', 'Horsepower', 'Miles_per_Gallon']).interactive()
生成以下图表:
我的问题是:有没有可能在输出的图表中取消这个图例?