# Creating a Sankey Plot

**URL:** <https://community.plotly.com/t/creating-a-sankey-plot/33413>\
**Category:** Dash Python\
**Created:** [January 9, 2020, 2:10pm UTC](https://community.plotly.com/t/creating-a-sankey-plot/33413 "2020-01-09T14:10:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam2](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@Sam2](https://community.plotly.com/u/Sam2)\
**Post date:** [January 9, 2020, 2:10pm UTC](https://community.plotly.com/t/creating-a-sankey-plot/33413/1 "2020-01-09T14:10:21Z")

</div>

I have the following data set in python dataframe:

```auto
    sem1|sem2|sem3|sem4
A 2|3|1|3
B 1|2|3|1

```

A and B are in the index column.How do I create a sankey plot for this data to show transition from one semester to another semester

---

<div class="post-metadata">

**Author:** ![Emmanuelle](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/emmanuelle/32/7853_2.png) [@Emmanuelle](https://community.plotly.com/u/Emmanuelle)\
**Post date:** [January 9, 2020, 4:43pm UTC](https://community.plotly.com/t/creating-a-sankey-plot/33413/2 "2020-01-09T16:43:06Z")

</div>

Hi @Sam2, did you take a look at the examples in [https://plot.ly/python/sankey-diagram/](https://plot.ly/python/sankey-diagram/)? Basically you need to extract the values from your dataframe for the `node` and `link` parameter of the trace.

---

<div class="post-metadata">

**Author:** ![Sam2](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@Sam2](https://community.plotly.com/u/Sam2)\
**Post date:** [January 9, 2020, 4:54pm UTC](https://community.plotly.com/t/creating-a-sankey-plot/33413/3 "2020-01-09T16:54:44Z")

</div>

Yes I visited it,but I am not sure how to extract it from the dataframe which I have

---

<div class="post-metadata">

**Author:** ![ViralT](https://avatars.discourse-cdn.com/v4/letter/v/7ea924/32.png) [@ViralT](https://community.plotly.com/u/ViralT)\
**Post date:** [August 12, 2020, 7:32am UTC](https://community.plotly.com/t/creating-a-sankey-plot/33413/4 "2020-08-12T07:32:55Z")

</div>

I have passed and plotted the Sankey diagram using the python library.  
But every time when I run, it is generated in local IP with a new port no like [http://127.0.0.1:54245/](http://127.0.0.1:54245/)  
Since I am using real values to plot the Sankey, I want the plot to be used in python so I want my graph to get updated as per the value, so I can use active to show the same graph in python
