Parallel coordinates plot with PlotlyJS

I would like to use PlotlyJS’s parallel coordinates plot to achieve something similar to this python
example. I have tried extracting into separate dataframes my separate groupings, built separate traces and then, finally

plot([trace1, trace2, trace3])

but this isn’t doing it for me. Does anybody have any suggestions?

Something along the lines of the example linked above would be even nicer but beggars can’t be choosers :slight_smile: .

Many thanks.

Have you tried the approach detailed on the Github PlotlyJS.jl site, here:

https://github.com/sglyon/PlotlyJS.jl/issues/218#issuecomment-419248422

I’m not sure if this is exactly what you want but perhaps it will give you some ideas.

Thanks for the suggestion. Yes, I knew about it and I had been using it as a starting point, and it got me a long way. However, I was not able to plot sub categories of my dataframe in different line colors and styles.

I’d love to hear of any leads or suggestions.

Thanks.

Okay. Well here is a MWE that starts with an (unstacked) dataframe and plots a parallel coordinates plot into three groups. Does this help get you closer?

using PlotlyJS, DataFrames

df = DataFrame(group=repeat([1,2,3], inner=10), response1 = rand(30), response2 = rand(30), response3=rand(30), response4=rand(30));

mytrace = parcoords(;line = attr(color=df.group, colorscale=[(0,"red"), (0.5,"green"),(1,"blue")]),
        dimensions = [
            attr(range = [0,1],
                 label = "response1", values = df.response1),
            attr(range = [0,1],
                 label = "response2", values = df.response2),
            attr(range = [0,1],
                 label = "response3", values = df.response3),
            attr(range = [0,1],
                 label = "response4", values = df.response4)
        ]);

myplot = plot(mytrace)

Thank you. That was the quantum I needed.