转自:数据可视化之MATPLOTLIB实战:PLT.POLAR()函数 绘制极线图
代码
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
# 防止乱码
mpl.rcParams["font.sans-serif"] = ["SimHei"]
mpl.rcParams["axes.unicode_minus"] = False
barSlices = 12
theta = np.linspace(0.0, 2*np.pi, barSlices, endpoint=False)
r = 30*np.random.rand(barSlices)
plt.polar(theta,r,
color = "chartreuse",
linewidth = 2,
marker = "*",
mfc = "b",
ms = 10)
plt.show()