0
私はパーセントベースの指標を視覚化するためにradar chart
のコンセプトで遊んでいました。サンプルコードに従っていますが、いくつかの項目に問題があります。誰かがラベルをデフォルトの度合の値から別のものに変更するのを助けてくれますか?私はまた、0.9にX軸の最小値を設定したいが、少し苦労した。レーダーチャートのラベルと軸の制限の編集
任意のヘルプまたはリソースが役立ちます。それらを解決するためのより効率的な方法があれば、私は再び始め直すことができます。
import numpy as np
import matplotlib.pyplot as plt
availability_array = np.array([.95, .9, .99, .97, 1]) #sample inverter uptime availability numbers using site with 5 inverters
# Compute pie slices
theta = np.linspace(0.0, 2 * np.pi, len(availability_array), endpoint=False)
values = availability_array #values that are graphed
width = 1 #increase/decrease width of each bar
ax = plt.subplot(111, projection='polar') #.set_xticklabels(['N', '', 'W', '', 'S', '', 'E', '']) #111 means 1x1 grid subplot starting in cell 1
bars = ax.bar(theta, values, width=width, bottom=0.0)
# Coloring
for r, bar in zip(values, bars):
bar.set_facecolor(plt.cm.viridis(r/1))
bar.set_alpha(0.4) #transparency of the bars
plt.show()