Last active
March 11, 2019 23:25
-
-
Save briochemc/0c29afdd89198dd712f3bf28bda58343 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using VegaLite, DataFrames | |
df = DataFrame(x = [0, 1, 2, 3, 4, 0, 1, 2, 3, 4], y = 1:10, style = ["A", "A", "A", "A", "A", "B", "B", "B", "B", "B"]) | |
list_styles = ["B", "A"] | |
mycolors = ["#000000", "#ee00ff"] | |
p = df |> | |
@vlplot( | |
mark={ | |
:line, | |
}, | |
encoding={ | |
x={:x, title="x axis"}, | |
y={:y, title="y axis"}, | |
shape={:style, typ="nominal", scale={domain=list_styles}}, | |
color={:style, typ="nominal", scale={range=mycolors, domain=list_styles}} | |
}, | |
resolve={ | |
scale={ | |
color="independent", | |
shape="independent" | |
}, | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment