期末报告:同行业十家公司

姓名:亢晨旭 学号:4201459

list_name_1 = [] for i in range(len(list_name)):#保留公司名称的前两个字 c_a = list_name[i] c_b = c_a[0:2] list_name_1.append(c_b) def y_ticks(list_row,name_list): num_list_1 = list_row rects = plt.barh(range(len(list_row)),num_list_1,color='rgby') N = 9 index = np.arange(N) plt.yticks(index,list_name_1,fontproperties = zhfont1) plt.title(name_list+"不同公司营业收入对比",fontproperties = zhfont1) plt.xlabel("营业收入(亿元)",fontproperties = zhfont1) plt.ylabel("公司名称",fontproperties = zhfont1) for rect in rects:
w=rect.get_width() plt.text(w,rect.get_y()+rect.get_height()/2,w,size =10,ha='left',va='center') plt.savefig(name_list +".png",dpi = 600) plt.show() for i in range(len(list_row)): y_ticks(list_row_1[i], name_list[i])