I have already spent quite some time searching for a solution online. I have created a stacked horizontal barplot with Matplotlib. I would like to increase the space between the bars but don't know how to do that.
import pandas as pd
import matplotlib.pyplot as plt
d = {
'id': [823,234,213,343,329,289,569,294,295,832],
'dogs': [1,2,3,4,3,5,2,3,4,5],
'cats': [3,4,5,2,1,3,4,5,3,2,],
'birds': [1,4,2,3,4,2,3,1,4,2]}
df = pd.DataFrame(data=d)
df.plot(
x = 'id',
kind = 'barh',
stacked = True,
title = 'Stacked Bar Graph',
mark_right = True,
color=['#D3E0F9','#7AA3F1','#3D68CF'],
width=0.6)
plt.rc('axes', titlesize=6) #fontsize of the title
plt.rc('axes', labelsize=10) #fontsize of the x and y labels
plt.rc('xtick', labelsize=10) #fontsize of the x tick labels
plt.rc('ytick', labelsize=10) #fontsize of the y tick labels
plt.rc('legend', fontsize=10) #fontsize of the legend