python - matplotlib 中的复杂极坐标图
解决方案
它看起来就像其他绘图一样matplotlib
,即如果你想绘制两条曲线,你会调用plt.polar
多次。
这是一个例子:
import numpy as np
import matplotlib.pyplot as plt
blue_thetas = np.linspace(np.pi/3, 2*np.pi/3, 100)
red_thetas = np.linspace(4*np.pi/3, 6*np.pi/3, 100)
blue_rs = np.random.uniform(4, 6, len(blue_thetas))
red_rs = np.random.uniform(3, 5, len(red_thetas))
red_curve = plt.polar(red_thetas, red_rs, c='r', label="calculated")
blue_curve = plt.polar(blue_thetas, blue_rs, c='b', label="measured")
plt.legend(loc=10)
plt.xticks(np.concatenate((red_thetas[::20], blue_thetas[::30])))
plt.title("test polar image")
plt.show()
来源:https ://matplotlib.org/3.1.1/gallery/misc/transoffset.html#sphx-glr-gallery-misc-transoffset-py
另一个可能对您有用的stackoverflow帖子是:浮动径向轴
推荐阅读
- reactjs - 阻止 StaticQuery 在未登录时公开数据
- sql - 使用 SQL 连接 Apache Superset 中的 3 个或更多表
- java - 是否可以在不允许修改的情况下提供对 ArrayList 的引用?
- amazon-redshift - 有没有办法在邮件的正文/标题中将 Quicksight 电子邮件报告更新到今天的日期?
- python - 通过一维数组读取问题
- java - SpringBoot项目中AS400 JDBC驱动问题
- excel - 检查列中的字符串是否以数组中的任何字符串开头?
- python - python:按多个字典键分组
- c - 如何对这个 c 函数进行单元测试?
- java - 构造函数抛出异常;