- 极坐标上的散点图
- 代码
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 16 20:07:14 2018
@author: LU
"""
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(19680801) # 随机数种子
N = 150
r = 2*np.random.rand(N) # 2x,1行N列
theta = 2*np.pi*np.random.rand(N) #2*pi*x
area = 200*r**2
colors = theta
fig = plt.figure()
ax = fig.add_subplot(111, projection='polar') #画布分割为1行1列,图像为从左到右从上到下数的第1块
c = ax.scatter(theta, r, c=colors, s=area, cmap='hsv', alpha=0.75)