VegaLite: tex support + edit legend

Thanks to everyone who is contributing to VegaLite.jl! It’s a fantastic addition to Julia’s plotting ecosystem.

Using the examples in the documentation, I was able to generate the plot below.

I have two questions related to its legend:

  1. Does VegaLite currently support latex? I would like to print the greek version of alpha.

  2. How can I edit the legend? For example, how can I remove its title (assuming I cannot tex it)? I found a close example here and instructions here but I am not able to port them into my code (see below).

plot_states

using VegaLite, VegaDatasets, DataFrames

us10m = dataset("us-10m")
df_income = DataFrame(dataset("income"))

# How to include my data
df_my_data = deepcopy(df_income);
filter!(row -> row.group .== "<10000", df_my_data);
filter!(row -> row.name .!= "Puerto Rico", df_my_data);
select!(df_my_data, [:name, :id, :pct]);
rename!(df_my_data, :pct => :alpha);

p_states = @vlplot(
    title="A nice plot",
    width=500, height=300,
    :geoshape,
    data=df_my_data,
    transform=[{
        lookup=:id,
        from={
            data={
                values=us10m,
                format={
                    type=:topojson,
                    feature=:states
                }
            },
            key=:id
        },
        as=:geo
    }],
    projection={type=:albersUsa},
    encoding={
        shape={field=:geo,type=:geojson},
        color={field=:alpha,type=:quantitative},
    }
)

Here are my temporary answers/solutions - looking forward to better ones.

  1. VegaLite does not support latex but you can use unicode as a work-around.
  2. The legend can be formatted by adding a specific entry after the color command.

See below how I managed to replace the alpha. If you want no legend title, use title=nothing.

    encoding={
        shape={field=:geo,type=:geojson},
        color={field=:chi_s,type=:quantitative,legend={title="α"}},
    }