matplotlib之极坐标系的极角网格线(thetagrids)的显示刻度
极坐标系的极角网格线(thetagrids)的显示刻度
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
############################
#File Name: polar.py
#Author: frank
#Mail: frank0903@aliyun.com
#Created Time:2018-05-22 22:08:01
############################
import matplotlib.pyplot as plt
import numpy as np
import matplotlib as mpl zhfont = mpl.font_manager.FontProperties(fname='/usr/share/fonts/truetype/wqy/wqy-microhei.ttc') ax = plt.subplot(111, polar=True) plt.figtext(0.52, 0.95, '默认labels为角度(degree)', ha='center', size=20,fontproperties=zhfont)
plt.thetagrids(np.linspace(0, 360, 6, endpoint=False))
plt.savefig('default_degrees.jpg') plt.figtext(0.52, 0.95, '指定labels', ha='center', size=20,fontproperties=zhfont)
plt.thetagrids(np.linspace(0, 360, 6, endpoint=False), ['a', 'b', 'c', 'd', 'e', 'f'])
plt.savefig('special_degrees.jpg') plt.show()


matplotlib.pyplot.thetagrids(*args, **kwargs)
Get or set the theta locations of the gridlines in a polar plot.
get or set 极角轴显示刻度。
If no arguments are passed, return a tuple (lines, labels) where lines is an array of radial gridlines (Line2D instances) and labels is an array of tick labels (Text instances):
lines, labels = thetagrids()
Otherwise the syntax is:
lines, labels = thetagrids(angles, labels=None, fmt='%d', frac = 1.1)
set the angles at which to place the theta grids (these gridlines are equal along the theta dimension).
angles is in degrees.
angles 是角度值,不能是弧度值。
labels, if not None, is a len(angles) list of strings of the labels to use at each angle.
If labels is None, the labels will be fmt%angle.
如果labels不为空,那么极角网格线的显示刻度为labels。
如果labels为空,那么极角网格线的显示刻度为 角度值。
frac is the fraction of the polar axes radius at which to place the label (1 is the edge). e.g., 1.05 is outside the axes and 0.95 is inside the axes.
frac 设置 极角显示刻度 距离 极角轴的距离。例如,极径为1,frac=1.1,那么极角的刻度显示的位置 离 r=1的极角网格线 0.1长度。
Return value is a list of tuples (lines, labels):
lines are Line2D instances
labels are Text instances.
Note that on input, the labels argument is a list of strings, and on output it is a list of Text instances.
matplotlib之极坐标系的极角网格线(thetagrids)的显示刻度的更多相关文章
- matplotlib之极坐标系的极径网格线(rgrids)的显示刻度
matplotlib之极坐标系的极径网格线(rgrids)的显示刻度 #!/usr/bin/env python3 #-*- coding:utf-8 -*- #################### ...
- matplotlib之创建极坐标系
#!/usr/bin/env python3 #-*- coding:utf-8 -*- ############################ #File Name: polar.py #Auth ...
- matplotlib极坐标系应用之雷达图
#!/usr/bin/env python3 #-*- coding:utf-8 -*- ############################ #File Name: test.py #Autho ...
- Python用matplotlib绘图网格线的设置
一.X轴网格线的设置 import matplotlib.pyplot as plt import numpy as np from pylab import mpl mpl.rcParams['fo ...
- 06. Matplotlib 2 |折线图| 柱状图| 堆叠图| 面积图| 填图| 饼图| 直方图| 散点图| 极坐标| 图箱型图
1.基本图表绘制 plt.plot() 图表类别:线形图.柱状图.密度图,以横纵坐标两个维度为主同时可延展出多种其他图表样式 plt.plot(kind='line', ax=None, figsiz ...
- Python自学笔记——matplotlib极坐标.md
一.极坐标 在平面内取一个定点O,叫极点,引一条射线Ox,叫做极轴,再选定一个长度单位和角度的正方向(通常取逆时针方向).对于平面内任何一点M,用ρ表示线段OM的长度(有时也用r表示),θ表示从Ox到 ...
- matplotlib极坐标方法详解
一.极坐标 在平面内取一个定点O,叫极点,引一条射线Ox,叫做极轴,再选定一个长度单位和角度的正方向(通常取逆时针方向).对于平面内任何一点M,用ρ表示线段OM的长度(有时也用r表示),θ表示从Ox到 ...
- 图表绘制工具--Matplotlib 2
''' [课程3.] 基本图表绘制 plt.plot() 图表类别:线形图.柱状图.密度图,以横纵坐标两个维度为主 同时可延展出多种其他图表样式 plt.plot(kind='line', ax=No ...
- 数据分析 大数据之路 六 matplotlib 绘图工具
散点图 #导入必要的模块 import numpy as np import matplotlib.pyplot as plt #产生测试数据 x = np.arange(1,10) y = x ...
随机推荐
- node.js 中createConnection参数说明
host:主机地址 (默认:localhost) user:用户名 password:密码 port:端口号 (默认:3306) database:数据库名 charset:连接字符集(默认:'UTF ...
- __argc和__argv变量
微软提供了全局变量__argc 和__argv.这两个变量由Windows在运行时自动赋值.其中__argv有ASCII和Unicode版本,分别为__argv和 __wargv.要使用这两个全局变量 ...
- 高级进阶DB2(第2版)
<高级进阶DB2(第2版)> 基本信息 作者: 牛新庄 出版社:清华大学出版社 ISBN:9787302323839 上架时间:2013-7-3 出版日期:2013 年7月 开本:16开 ...
- 项目中集成Easyui-Tree,可拖拽更新节点
由于公司架构较旧,使用的jdk版本为1.4,页面上也没有el表达式. Html <ul class="easyui-tree" id="data"> ...
- 如何在windows下的Python开发工具IDLE里安装其他模块
以安装Httplib2模块为例 1 下载模块 到 “https://code.google.com/p/httplib2/” 下载一款适合你的压缩包“httplib2-0.4.0.zip” 2 解压下 ...
- Linux/Unix C编程之的perror函数,strerror函数,errno
#include <stdio.h> // void perror(const char *msg); #include <string.h> // char *strerro ...
- ajax常用请求方式
1.JAVA @RequestMapping(value = "testAjax") @ResponseBody public Map<String, Object> ...
- 轻松编写 C++ 单元测试
单元测试概述 测试并不只是测试工程师的责任,对于开发工程师,为了保证发布给测试环节的代码具有足够好的质量( Quality ),为所编写的功能代码编写适量的单元测试是十分必要的. 单元测试( Unit ...
- [ToDo]Thrift学习
这里有较详细的Java项目配置过程: http://bglmmz.iteye.com/blog/2058785 下面有Java项目的示例介绍: http://www.tuicool.com/artic ...
- 如何查看Oracle日志
Oracle日志查看 一.Oracle日志的路径: 登录:sqlplus "/as sysdba" 查看路径:SQL> select * from v$logfile; SQ ...