应用场景:探究不同变量之间的内在关系
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
if __name__ == "__main__":
# 0、修改支持中文的字体
plt.rcParams["font.sans-serif"] = ["SimHei"] # 设置字体
plt.rcParams["axes.unicode_minus"] = False # 解决图像中 "-" 负号乱码问题
x = [225.98, 247.07, 253.14, 457.85, 241.58, 301.01, 20.67, 288.64,
163.56, 120.06, 207.83, 342.75, 147.9, 53.06, 224.72, 29.51,
21.61, 483.21, 245.25, 399.25, 343.35]
y = [196.63, 203.88, 210.75, 372.74, 202.41, 247.61, 24.9, 239.34,
140.32, 104.15, 176.84, 288.23, 128.79, 49.64, 191.74, 33.1,
30.74, 400.02, 205.35, 330.64, 283.45]
plt.figure(figsize=(20, 8), dpi=80)
plt.scatter(x, y)
plt.show()
标签:__,plt,散点图,matplotlib,rcParams,import
From: https://www.cnblogs.com/correct/p/17142368.html