擅长:python、mysql、java
<p>我相信其他人会有更好的建议,但有一种方法可以得到你想要的东西(不需要额外的轴艺术家),那就是将极轴投影与散点图和条形图结合使用。差不多</p>
<pre><code>import matplotlib.pyplot as plt
import numpy as np
x = np.random.uniform(size=100)
y = np.random.uniform(size=100)
r = np.sqrt(x**2 + y**2)
phi = np.arctan2(y, x)
h, b = np.histogram(phi, bins=np.linspace(0, np.pi/2, 21), density=True)
colors = plt.cm.Spectral(h / h.max())
ax = plt.subplot(111, projection='polar')
ax.scatter(phi, r, marker='.')
ax.bar(b[:-1], h, width=b[1:] - b[:-1],
align='edge', bottom=np.max(r) + 0.2, color=colors)
# Cut off at 90 degrees
ax.set_thetamax(90)
# Set the r grid to cover the scatter plot
ax.set_rgrids([0, 0.5, 1])
# Let's put a line at 1 assuming we want a ratio of some sort
ax.set_thetagrids([45], [1])
</code></pre>
<p>这将给
<a href="https://i.stack.imgur.com/Gw4rh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Gw4rh.png" alt="enter image description here"/></a></p>
<p>它缺少轴线标签和一些美化,但它可能是一个开始。我希望这是有帮助的</p>