Power BI 条形图组图加堆叠图

添加python图,以下代码

import matplotlib.pyplot as plt

import numpy as np

index = np.arange(dataset.shape[0])

p1 =plt.bar(index,dataset["MC_fas"], width=0.3 , color='lightgreen')

p2 =plt.bar(index,dataset["SC_fas"], width=0.3 , color='limegreen')

plt.xticks(index,dataset["product"], rotation = 45)

bar_width = 0.3

p3 =plt.bar(index +  bar_width, dataset["MC_simul_d"], width=0.3 , color='deepskyblue')

p4 =plt.bar(index +  bar_width, dataset["SC_simul_d"], width=0.3 , color='dodgerblue')

plt.legend(["MC_fas","SC_fas","MC_simul","SC_simul"],loc=1)

plt.title('MC SC ')

plt.show()


©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。