如何使用Python,画出类似下图所示的折线图
4条回答 默认 最新
关注
根据你的问题,下面专门为你解答,可直接运行下面代码:
import matplotlib.pyplot as plt # 设置图框的大小 fig = plt.figure(figsize=(10,6)) x = [0,1, 2, 3,4,5,6,7,8,9,10] y = [0,25,40,50,58,65,71,76,80,82,88] # 绘图 plt.plot(x, # x轴数据 y, # y轴数据 linestyle = '-', # 折线类型 linewidth = 2, # 折线宽度 color = 'steelblue', # 折线颜色 marker = '*', # 点的形状 markersize = 6, # 点的大小 markeredgecolor='black', # 点的边框色 markerfacecolor='green') # 点的填充色 # 添加标题和坐标轴标签 plt.xlabel('Number of anchor boxes') plt.ylabel('Average IoU/%') plt.show()
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报