【Python】Matplotlib绘制极坐标雷达图
生活随笔
收集整理的這篇文章主要介紹了
【Python】Matplotlib绘制极坐标雷达图
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
Matplotlib編程實(shí)現(xiàn)
import numpy as np import matplotlib.pyplot as pltnum = 20 theta = np.linspace(0.0, 2 * np.pi, num, endpoint=False) radii = 10 * np.random.rand(num) width = np.pi / 4 * np.random.rand(num)ax = plt.subplot(111, projection='polar') bars = ax.bar(theta, radii, width=width, bottom=0.0)for r, bar in zip(radii, bars):bar.set_facecolor(plt.cm.viridis(r / 10.))bar.set_alpha(0.5)plt.show()成品圖欣賞
總結(jié)
以上是生活随笔為你收集整理的【Python】Matplotlib绘制极坐标雷达图的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【Python】可视化的离散傅里叶变换+
- 下一篇: 用任意合法序列建立一棵二叉树(洛谷P13