def generic_stacked_barplot(df, pdf, title_string, legend_labels, ylabel, names, box_label, bbox_to_anchor=(1.12, 0.7)):
fig, ax = plt.subplots()
bars = []
cumulative = np.zeros(len(df.columns))
color_palette = choose_palette(legend_labels)
for i, (_, d) in enumerate(df.iterrows()):
bars.append(ax.bar(np.arange(len(df.columns)), d, bar_width, bottom=cumulative,
color=color_palette[i], linewidth=0.0))
cumulative += d
_generic_histogram(bars, legend_labels, title_string, pdf, ax, fig, ylabel, names, box_label, bbox_to_anchor)
###
# Shared functions
###
plots.py 文件源码
python
阅读 30
收藏 0
点赞 0
评论 0
评论列表
文章目录