Skip to content

Instantly share code, notes, and snippets.

@briochemc
Last active March 11, 2019 23:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save briochemc/0c29afdd89198dd712f3bf28bda58343 to your computer and use it in GitHub Desktop.
Save briochemc/0c29afdd89198dd712f3bf28bda58343 to your computer and use it in GitHub Desktop.
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