极坐标系的极角网格线(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.

reference: https://matplotlib.org/api/_as_gen/matplotlib.pyplot.thetagrids.html?highlight=thetagrids#matplotlib.pyplot.thetagrids

matplotlib之极坐标系的极角网格线(thetagrids)的显示刻度的更多相关文章

  1. matplotlib之极坐标系的极径网格线(rgrids)的显示刻度

    matplotlib之极坐标系的极径网格线(rgrids)的显示刻度 #!/usr/bin/env python3 #-*- coding:utf-8 -*- #################### ...

  2. matplotlib之创建极坐标系

    #!/usr/bin/env python3 #-*- coding:utf-8 -*- ############################ #File Name: polar.py #Auth ...

  3. matplotlib极坐标系应用之雷达图

    #!/usr/bin/env python3 #-*- coding:utf-8 -*- ############################ #File Name: test.py #Autho ...

  4. Python用matplotlib绘图网格线的设置

    一.X轴网格线的设置 import matplotlib.pyplot as plt import numpy as np from pylab import mpl mpl.rcParams['fo ...

  5. 06. Matplotlib 2 |折线图| 柱状图| 堆叠图| 面积图| 填图| 饼图| 直方图| 散点图| 极坐标| 图箱型图

    1.基本图表绘制 plt.plot() 图表类别:线形图.柱状图.密度图,以横纵坐标两个维度为主同时可延展出多种其他图表样式 plt.plot(kind='line', ax=None, figsiz ...

  6. Python自学笔记——matplotlib极坐标.md

    一.极坐标 在平面内取一个定点O,叫极点,引一条射线Ox,叫做极轴,再选定一个长度单位和角度的正方向(通常取逆时针方向).对于平面内任何一点M,用ρ表示线段OM的长度(有时也用r表示),θ表示从Ox到 ...

  7. matplotlib极坐标方法详解

    一.极坐标 在平面内取一个定点O,叫极点,引一条射线Ox,叫做极轴,再选定一个长度单位和角度的正方向(通常取逆时针方向).对于平面内任何一点M,用ρ表示线段OM的长度(有时也用r表示),θ表示从Ox到 ...

  8. 图表绘制工具--Matplotlib 2

    ''' [课程3.] 基本图表绘制 plt.plot() 图表类别:线形图.柱状图.密度图,以横纵坐标两个维度为主 同时可延展出多种其他图表样式 plt.plot(kind='line', ax=No ...

  9. 数据分析 大数据之路 六 matplotlib 绘图工具

      散点图 #导入必要的模块 import numpy as np import matplotlib.pyplot as plt #产生测试数据 x = np.arange(1,10) y = x ...

随机推荐

  1. linux Socket send与recv函数详解

    转自:http://www.cnblogs.com/blankqdb/archive/2012/08/30/2663859.html linux send与recv函数详解   1 #include ...

  2. Endnote在latex中的应用的两种方法

    从endnote中向latex文档批量插入参考文献的两种方法 一.若是latex模板中参考文献编写的命令是: \begin{thebibliography} \bibitem{lab1}LIU M L ...

  3. vc2005(visual studio)使用习惯记录

    来源:http://blog.csdn.net/zdl1016/article/details/6184549 前言:sourceinsight不支持显示utf-8的文件, 实在是一大遗憾!vim现在 ...

  4. scrapy-splash抓取动态数据例子八

    一.介绍 本例子用scrapy-splash抓取界面网站给定关键字抓取咨询信息. 给定关键字:个性化:融合:电视 抓取信息内如下: 1.资讯标题 2.资讯链接 3.资讯时间 4.资讯来源 二.网站信息 ...

  5. SVN配置常见错误

    1.svnserve.conf:12: Option expected 为什么会出现这个错误呢,就是因为subversion读取配置文件svnserve.conf时,无法识别有前置空格的配置文件,如 ...

  6. 【转】php中的会话机制(2)

    原文:https://segmentfault.com/a/1190000000468220 发现,在调用session_start()的时候, session_start() 里面应该是有调用类似 ...

  7. Set 遍历的三种方法

    1.迭代遍历:Set<String> set = new HashSet<String>();Iterator<String> it = set.iterator( ...

  8. jstl表达式引用文件

    <script type="text/javascript" src="<c:url value="/resources/js/common/jqu ...

  9. maven install时报错Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test

    事故现场: 解决办法: 一是命令行, mvn clean package -Dmaven.test.skip=true 二是写入pom文件, <plugin> <groupId> ...

  10. 《C++ Primer》 第四版 第7章 函数

    <C++ Primer> 第四版 第7章 函数 思维导图笔记 超级具体.很具体,图片版,有利于复习查看 http://download.csdn.net/detail/onlyshi/94 ...