Skip to content

Sankey : How to add source labels #3129

@swaticolab

Description

@swaticolab

Hi,

I am trying to plot a Sankey diagram for the below data:

data = go.Sankey(link = link, node=node,node_pad=20)
print(data)

Sankey({
'link': {'source': [567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567,
567, 567, 567, 567, 567],
'target': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
'value': [15, 11, 3, 3, 65, 7, 2, 27, 49, 19, 45, 107, 128, 48, 1, 3]},
'node': {'label': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 567], 'pad': 50, 'thickness': 5}
})


fig = go.Figure(data)
fig.show()

I am able to get the labels for target node, but not the source node(=567)
newplot (1)

. Is there something I am missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions