I cannot reproduce this example plot from Vega-lite
kavir1698 opened this issue · comments
Farhad Vahdati commented
I am trying to set color values from a field, replicating this example. However, I get no plot. Here is my code:
using VegaLite
using DataFrames
df = DataFrame(Dict(
:y => ["X", "Y", "Z"],
:l => ["A", "B", "C"],
:c => ["red", "green", "blue"]
))
df |> @vlplot(
mark = :circle,
y = "y:n",
color = {
field = "l:n",
scale = {range = {field = :c}}
}
)
I have tested it with VegaLite v2.3.0 on Windows and Linux. Is this a bug?
José Bayoán Santiago Calderón commented
Seems the scale range expects a number, but you are passing text.
Farhad Vahdati commented
Text works in the original vega-lite example.
Mary McGrath commented
what if you use the literal "c"
instead of :c
?
Farhad Vahdati commented
Doesn't help.
Mary McGrath commented
It looks like this feature was added in vega-lite v4.14 and VegaLite.jl currently uses v4.13, so this will become supported whenever that update is made. https://github.com/vega/vega-lite/releases/tag/v4.14.0
Farhad Vahdati commented
Right! Thanks for the feedback.