http://matplotlib.org/gallery/index.html
交互式绘图
plotly:可视化工具中的github,相比于matplotlib更加简单,图形更加漂亮,同时兼容matplotlib和pandas
使用用法:简单,照着文档写即可
plotly:可视化工具中的github,相比于matplotlib更加简单,图形更加漂亮,同时兼容matplotlib和pandas
使用用法:简单,照着文档写即可
- plt.plot() 折线图
- plt.scatter() 散点图
- plt.bar(),plt.barh() 条形图
- plt.hist() 直方图
用matplotlib 绘图用的元素
- plt.figure() 设置图片格式
- plt.savefig(' 文件路径') 保存图片
- plt.xticks( 参数1, 参数2 ,。。。) 设置刻度,第一个参数为坐标轴位置,第二参数表示文字,rotation旋转角度,
- plt.xlabel(),plt.ylabel(),plt.tiltle() 添加坐标轴描述信息
- plt.legend(prop=' ',位置信息) 添加图例
- plt.show() 显示图片
- 设置字体 my_font=font_manager.FontProperties(fname='C:\Windows\Fonts\msyh.ttc')
1、绘制折线图
#功能实现:10点到12点的万气温走势图
from matplotlib import pyplot as plt
from matplotlib import font_manager