Matplotlib绘制极坐标散点图

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()

成品图欣赏

在这里插入图片描述在这里插入图片描述

发布了505 篇原创文章 · 获赞 999 · 访问量 19万+

猜你喜欢

转载自blog.csdn.net/weixin_43896318/article/details/104296274