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 ...
随机推荐
- meteor学习-- #一 安装meteor快速使用
下载安装 curl https://install.meteor.com/ | sh meteor会自动下载mongodb和其他需要依赖的库,不需要手动安装. 如果是Windows 的用户,请使用 m ...
- easyui 消息提示框
1.浏览器消息提示框 浏览器弹出框,可以在浏览器设置中被屏蔽掉,导致效果失效 alert() 2.easyui 框架提供的消息框 easyui 框架自带的消息框,不可以被屏蔽. $.messager. ...
- docker部署golang+redis聊天室
博客地址:http://www.niu12.com/article/7#####1.项目源码: https://github.com/ZQCard/webchat#####2.项目构成 websock ...
- 在 Android Studio 2.2 中愉快地使用 C/C++
转载请注明出处:http://blog.csdn.net/wl9739/article/details/52607010 注:官网上面的技术文章也在不断地汉化中,只是进度有点慢.在我翻译本篇文章的时候 ...
- yum安装 lnmp (linux+nginx+php7.1+mysql5.7)
1.第一步先更新yum update 2.yum安装nginx安装nginx最新源:yum localinstall http://nginx.org/packages/centos/7/noarch ...
- 字符编码,pyton中的encode,decode,unicode()
1.在计算机处理的程序中,对字符的处理有两种方式:编码或译码(encoding),解码(decoding) encoding:将字符串中的字符转换到对应编码字符集对应的代码点 ...
- Solidworks如何设置零件材料,如何评估零件质量
右击材质,然后编辑材料,在弹出菜单中在Solidworks materials中选择零件材料(一般钢或者铁,注意质量密度是否跟你需要的一致),完成之后点击应用和关闭 在评估-质量属性中可以看到当前 ...
- java中异常介绍
一.异常概述 异常处理已经成为衡量一门语言是否成熟的标准之一,目前的主流编程语言如C++.C#.Ruby.Python等,大都提供了异常处理机制.增加了异常处理机制后的程序有更好的容错性,更加健壮. ...
- js 因加入form导致两个table之间出现空白问题
在<FORM>中加CSS <table> ....... </table> <form style="padding:0; margin:0;&qu ...
- SpringMVC响应Restful风格请求404
在学习Springmvc时,使用Restful风格的url,页面提示404错误.为找到原因,编写一个简单的Restful测试用例如下: jsp页面: <a href="user/tes ...