使用 physt 庫,您可以創建自動返回顏色條的數據極坐標直方圖,例如:from physt.histogram_nd import Histogram2D# Histogram2D([radian_bins, angular_bins], [histogram values for given bins])hist = Histogram2D([[0, 0.5, 1], [0, 1, 2, 3]], [[0.2, 2.2, 7.3], [6, 5, 3]])ax = hist.plot.polar_map(cmap = 'viridis', show_zero=False)我無法鏈接此輸出的圖像,因為我似乎還沒有足夠的聲譽。顏色條已創建,看起來很棒,但沒有任何標簽。我可以在 Polar_map 函數中使用一些關鍵字或爭論來:標記我的顏色條或提取顏色條對象,以便我可以使用已建立的函數,例如:cbar.ax.set_ylabel("colorbar?name")
1 回答

12345678_0001
TA貢獻1802條經驗 獲得超5個贊
您確實可以使用以下命令提取顏色條對象ax.get_figure():
from physt.histogram_nd import Histogram2D
#
# Histogram2D([radian_bins, angular_bins], [histogram values for given bins])
hist = Histogram2D([[0, 0.5, 1], [0, 1, 2, 3]], [[0.2, 2.2, 7.3], [6, 5, 3]])
ax = hist.plot.polar_map(cmap = 'viridis', show_zero=False)
fig = ax.get_figure()
fig.axes[1].set_ylabel("colorbar name")
添加回答
舉報
0/150
提交
取消