Plot multiple similar CSVs with AoG

Nathan_Boyer
Wed, 08 Feb 2023 14:32:56 +0000
Visualization

I am loading multiple CSV files and want to plot them on top of each other, but I can’t figure out an easy way to change the line color and style to identify them in a legend.

df1 = DataFrame("X Data" => 1:3, "Unused Data" => 4:6, "Y Data" => 7:9) # CSV.read("file1.csv", DataFrame)
df2 = DataFrame("X Data" => 0:3, "Unused Data" => 4:7, "Y Data" => fill(8,4)) # CSV.read("file2.csv", DataFrame)
draw(
    (data(df1) + data(df2)) *
    mapping("X Data", "Y Data") *
    visual(Lines)
)

I imagine there should be a way to make line 4 something like

(data(df1) * mapping(linestyle="Sample 1", color="Sample 1") + data(df2) * mapping(linestyle="Sample 2", color="Sample 2"))

but I can’t get the syntax right.

I have six CSVs. I’d like two different line styles and three different colors for grouping them.

13 posts - 4 participants