欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

极坐标数据可视化

最编程 2024-03-30 09:03:23
...
 极坐标/雷达图*****    polar=True?
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams[
'font.family'] = ['SimHei']

# 准备数据
r=np.arange(0,2,0.01)
theta =
2*np.pi*r
# 准备画布
fig = plt.figure()
ax =plt.subplot(
111,projection='polar')
ax.plot(theta,r)
ax.set_rmax(
2)
ax.set_rticks([
0.5,1,1.5,2])    # 减少r向刻度
ax.set_rlabel_position(250)     # 设置r向刻度标签至250度方向
ax.grid(True)                   # 网格线图
ax.set_title("极坐标")
plt.show(
block=True)