#绘制散点图
#练习:
'''
假设通过爬虫获得了2016年3,10月份每天白天的最高气温(分别位于列表a,b),寻找气温和随时间
(天)变化的某种规律
a=[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]
b=[26,26,28,29,19,21,17,16,19,18,20,20,19,22,23,17,20,21,22,20,15,11,15,5,13,17,10,11,13,12,13,6]
技术要求:plt.scatter(x,y)
'''
#简单版-不清晰
'''
import matplotlib.pyplot as plt
y_3=[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]
y_10=[26,26,28,29,19,21,17,16,19,18,20,20,19,22,23,17,20,21,22,20,15,11,15,5,13,17,10,11,13,12,13]
x=range(1,32)
plt.scatter(x,y_3)
plt.scatter(x,y_10)
#展示
plt.show()
'''
#升级:
'''
import matplotlib.pyplot as plt
y_3=[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]
y_10=[26,26,28,29,19,21,17,16,19,18,20,20,19,22,23,17,20,21,22,20,15,11,15,5,13,17,
Python数据分析--散点图、条形图
最新推荐文章于 2024-04-21 11:31:02 发布
本文深入探讨使用Python进行数据分析时如何绘制散点图和条形图,通过实例展示matplotlib库的使用,揭示数据可视化的重要性和基本技巧。
摘要由CSDN通过智能技术生成