Skip to content

Sankey-chart-budget-contribution

Để vẽ các budget contribution chart thì từ khóa để tìm kiếm là sankey chart. Có môt dạng tương tự là Alluvial chart

Python package

Matplotlib package của Python cho phép vẽ Sankey chart

import matplotlib.pyplot as plt
from matplotlib.sankey import Sankey

Sankey(flows=[0.25, 0.15, 0.60, -0.20, -0.15, -0.05, -0.50, -0.10],
       labels=['', '', '', 'First', 'Second', 'Third', 'Fourth', 'Fifth'],
       orientations=[-1, 1, 0, 1, 1, 1, 0, -1]).finish()
plt.title("The default settings produce a diagram like this.")


Có thể follow một tutorial rất chi tiết tại website này

No other pages link to this page.



Created : Nov 7, 2023