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:
-
Does VegaLite currently support latex? I would like to print the greek version of alpha.
-
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).
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},
}
)