import matplotlib.pyplot as plt

数据

month_number = [1,2,3,4,5,6,7,8,9,10,11,12] toothpaste = [5200, 5100, 4550, 5870, 4560, 4890, 4780, 5860, 6100, 8300, 7300, 7400]

绘图

plt.scatter(month_number, toothpaste, marker='x', color='blue')

图例

plt.legend(['Toothpaste'], loc='upper left')

图题

plt.title('图二:牙膏售卖量散点图')

X轴标签

plt.xlabel('Month Number')

Y轴标签

plt.ylabel('Number of Units Sold')

背景网格

plt.grid(True, linestyle='-')

显示图形

plt.show()

牙膏销售量散点图:每月趋势分析

原文地址: https://www.cveoy.top/t/topic/bHqp 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录