Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

How to deal with nodes with no outgoing and incoming flows but show them in Sankey diagram with plotly module in Python?

$
0
0

I am just wondering how to deal with the nodes with no incoming and outgoing flows in Sankey diagram with plotly in Python. To be specific, let's say there are some nodes and links for all nodes but there is no link for "A3" but exists in node set as follows:

import plotly.graph_objects as gofig = go.Figure(data=[go.Sankey(    node = dict(      pad = 15,      thickness = 20,      line = dict(color = "black", width = 0.5),      label = ["A1", "A2", "B1", "B2", "C1", "C2", "A3"],      color = "blue"    ),    link = dict(      source = [0, 1, 0, 2, 3, 3],      target = [2, 3, 3, 4, 4, 5],      value = [8, 4, 2, 8, 4, 2]  ))])fig.show()

In this case, how can I show "A3" in sankey diagram with specific width and height for its node? Thank you in advance!


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>