In [1]:
import sankey
import matplotlib.pyplot as plt
%matplotlib inline
import pandas as pd
pd.options.display.max_rows=8
In [2]:
df = pd.read_csv('./fruits.txt',sep = ' ',names=['true','predicted'])
In [3]:
df
Out[3]:
In [4]:
colorDict = {'apple':'#f71b1b','blueberry':'#1b7ef7','banana':'#f3f71b','lime':'#12e23f','orange':'#f78c1b'}
In [5]:
sankey.sankey(df['true'],df['predicted'],aspect=20,colorDict=colorDict,fontsize=10)
plt.gcf().set_size_inches(6,6)
plt.savefig('fruits.png',bbox_inches='tight',dpi=150)
In [ ]: