可视化——matplotlib常见api(四)
2016-02-20 08:52
555 查看
plt.xticks()
第一个参数接受坐标,第二个参数接受,各坐标显示的文本,关键字参数,如 rotation,表示文本显示时旋转的角度,为了达到一种美观的效果。import matplotlib.pyplot as plt import numpy as np if __name__ == '__main__': data = [5840, 5704, 5754, 5431, 5322, 2392, 3225, 5296, 5488, 5713, 5542, 5928, 2848, 3048, 5216, 5072, 5480, 5832, 4816, 2748, 2536, 5384, 5288, 5928, 5896, 5952, 2792, 2600, 5000, 4704] plt.plot(data) width = 1. plt.xticks(np.arange(len(data))+width/2, ['9/'+str(i) for i in range(1, 31)], rotation=60) plt.show()
绘图基本选项
相关文章推荐
- Debian安装使用tftp
- RHEL7学习之crontab无法执行ntpdate
- php解析xml,并将xml转换为层级数组
- php分享十八:网页抓取
- ThinkPHP的URL重写时遇到No input file specified的解决方法
- ContentProvider:读取手机通讯录、号码等信息(16)
- JFrame的setBackGround与getContentPane().setBackground区别
- 从耳机接口的OMTP和CTIA标准说起
- IDEA ant连接ftp报错NoClassDefFoundError
- 20.php回调、匿名函数、和闭包操作
- imagettftext(): any2eucjp(): invalid code in input string
- MySQL_PDO访问.php
- PHP之创建对象的基本形式
- ThinkPHP框架总结之安全及使用
- thinkphp的select和find的区别(转)
- ThinkPHP - Widget 工具
- php错误及异常
- PHP需要掌握的一些工具
- php5.6 源码安装过程
- php array_intersect() 和 array_diff() 函数