成都oppo加班严重嘛,刚收到offer
点赞 9

相关推荐

头像
03-13 16:35
已编辑
厦门大学 计算机类
绘图代码如下def plot_percentage(data,file_name):    # 对数据进行排序    sorted_data = np.sort(data)    # 计算小于每个值的百分比    percentages = np.arange(1, len(sorted_data) + 1) / len(sorted_data)    # 绘制曲线图    plt.figure(figsize=(20, 6))    plt.plot(sorted_data, percentages)    plt.xlabel('t (seconds)')    plt.ylabel('Percentage')    plt.title('Percentage of Values Less Than t')    plt.xticks([1, 2, 4, 8, 30, 60, 120, 1800, 3600],               ['1s', '2s', '4s', '8s', '30s', '1m', '2m', '30m', '1h'],rotation=45)        plt.xlim(0, 4000)    #for x, y in zip(sorted_data, percentages):        #plt.annotate(f'{y:.2%}', (x, y), textcoords="offset points", xytext=(0,10), ha='center')    plt.savefig(file_name+'.png')    plt.show()横坐标时间,纵坐标百分比想要实现的图1的但是代码实现是图2,求帮助
点赞 评论 收藏
转发
牛客网
牛客企业服务