欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Matplotlib绘制极坐标散点图

程序员文章站 2022-07-14 10:05:49
...

Matplotlib编程实现

import numpy as np
import matplotlib.pyplot as plt

num = 150
r = 2 * np.random.rand(num)
theta = 2 * np.pi * np.random.rand(num)
area = 200 * r**2
colors = theta

ax = plt.subplot(111, projection='polar')
c = ax.scatter(theta, r, c=colors, s=area, cmap='hsv', alpha=0.75)

plt.show()

成品图欣赏

Matplotlib绘制极坐标散点图Matplotlib绘制极坐标散点图

相关标签: # Python-Matplotlib