colors = sns.color_palette("Set2", n_colors = 4)
cmap = LinearSegmentedColormap.from_list("my_colormap", colors)
ax = df_pos_time.plot(kind = 'barh', stacked = True, figsize = (14, 7), colormap = cmap, ec = 'w')
plt.legend(loc = 'center left', bbox_to_anchor = (1.0, 0.5), fontsize = 14)
for p in ax.patches:
left, bottom, width, height = p.get_bbox().bounds
if width > 0:
ax.annotate(f'{width:0.1f}%', xy=(left+width/2, bottom+height/2), ha='center', va='center', fontsize=13)
ax.xaxis.set_visible(False)
plt.box(False)
plt.yticks(fontsize=17)