3

I'm trying to create a poster-style plot for several parallel coordinate charts using plotly's Parcoords. The first parallel coordinate chart displays correctly but the others only show the axes of the chart (which look correct) but not the connecting lines.

The chart in the top left is correct but the others don't have any connecting lines

Here is the code that generates the plots:

import plotly.graph_objects as go
from plotly.subplots import make_subplots

fig = make_subplots(rows=2, cols=2, 
                    specs=[[{"type": "domain"},{"type": "domain"}],
                    [{"type": "domain"}, {"type": "domain"}]])

X = [[1,3,5,6],[3,6,8,9]]
Y = [[9,5,8,0],[7,2,10,8]]
Z = [[10,20,30,40],[4,8,9,17]]

for i in range(2):
    for j in range(2):
        x=X[i]
        y=Y[j]
        z=Z[j]

        fig.append_trace(go.Parcoords(
            line = dict(color = z, colorscale = 'viridis', showscale = True),
            dimensions = list([dict(label = 'x', values = x), 
                               dict(label = 'y', values = y)])), 
            row=i+1, col=j+1)

fig.update_layout(height=400, width=400, title_text="Stacked subplots")
fig.show()

I haven't found any other posts that illustrate this problem. I'd appreciate any help to resolve it.

pcmitch
  • 31
  • 3
  • 1
    Please consider providing a complete code snippet with imports and everything you need to replicate you existing plot. Including a data sample. That would increase you chances of receiving a useful answer considerably. – vestland Feb 25 '20 at 12:49
  • 2
    Thanks - I updated my question with a simpler and complete code example. – pcmitch Feb 25 '20 at 23:24
  • FWIW, I was able to reproduce this in Plotly 5.15.0. Note that `append_trace()` is deprecated and you should use `add_trace()`. – Tom Johnson Aug 09 '23 at 11:09

0 Answers0