Colored Text Scatter Plot

< Stacked Bar Chart | Example Gallery | Text Table Heatmap >

from altair import *

Chart('https://vega.github.io/vega-lite/data/cars.json').mark_text().encode(
    color='Origin:N',
    text='OriginInitial:N',
    x='Horsepower:Q',
    y='Miles_per_Gallon:Q',
).transform_data(
    calculate=[Formula(
            expr='datum.Origin[0]',
            field='OriginInitial',
        )],
)