likert_colors = ['white', 'firebrick', 'lightcoral', 'gainsboro',
    'cornflowerblue', 'darkblue']
dummy = pd.DataFrame([[1, 2, 3, 4, 5], [5, 6, 7, 8, 5], [10, 4, 2, 10, 5]],
    columns=['SD', 'D', 'N', 'A', 'SA'], index=['Key 1', 'Key B', 'Key III'])
middles = dummy[['SD', 'D']].sum(axis=1) + dummy['N'] * 0.5
longest = middles.max()
dummy.insert(0, '', (middles - longest).abs())
dummy.plot.barh(stacked=True, color=likert_colors, edgecolor='none', legend
    =False)
z = plt.axvline(longest, linestyle='--', color='black', alpha=0.5)
z.set_zorder(-1)
plt.xlim(0, complete_longest)
Create a Diverging Stacked Bar Chart in matplotlib