def plot_stack_cum(semantic, *reports, color_theme = C_cold_colors, color_offset = 0):
""" Creates a stacked plot with cumulated sums for a given semantic """
X, Y, c = extract_data(semantic, *reports, color_theme = color_theme, color_offset = color_offset)
Y = remove_nones(Y)
# add zeros only at the beginning
for x in X:
x.insert(0, x[0] - 1)
for data in Y:
for d in data:
d.insert(0, 0.)
# create the cumulated sum
Y = [np.cumsum(np.array(yi), 1) if yi else [] for yi in Y]
plot_stack_generic(X, Y, c, semantic, *reports, color_theme = color_theme, color_offset = color_offset)
legend(loc = 'upper left', fancybox=True, framealpha=0.4, prop={'size':10})
评论列表
文章目录