2025年2月9日(数据分析_2)

在这里插入图片描述

散点图

from matplotlib import pyplot as plt
from matplotlib import font_manager  # 字体相关

# 字体
font_path = r"C:\Windows\Fonts\msyh.ttc"
my_font = font_manager.FontProperties(fname=font_path)

x = list(range(31))
x2 = list(range(31, 62))
a3 = [11, 17, 16, 11, 12, 11, 12, 6, 6, 7, 8, 9, 12, 15, 14, 17,
      18, 21, 16, 17, 20, 14, 15, 15, 15, 19, 21, 22, 22, 22, 23]
b10 = [26, 26, 28, 19, 21, 17, 16, 19, 18, 20, 20, 19, 22, 23,
       17, 20, 21, 20, 22, 15, 11, 15, 5, 13, 17, 10, 11, 13, 12, 13, 6]

# 绘图
_xtick_labels = ["3月{}号".format(i) for i in range(31)]
_xtick_labels += ["10月{}号".format(i) for i in range(31, 62)]

plt.xticks((x+x2)[::3], _xtick_labels[::3], rotation=45, fontproperties=my_font)

plt.scatter(x, a3)
plt.scatter(x2, b10)

# 展示
plt.show()

散点图

from matplotlib import pyplot as plt
from matplotlib import font_manager  # 字体相关# 字体

font_path = r"C:\Windows\Fonts\msyh.ttc"
my_font = font_manager.FontProperties(fname=font_path)

# 参数
y_3 = [11, 17, 16, 11, 12, 11, 12, 6,
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Mason Lin

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值