0
我想添加標籤由matplotlib自動生成點的熊貓數據框對象添加標籤點,但我不知道如何從我的熊貓找到點(boldened i
及以下j
) DataFrameGroupby對象。我的命令來創建一個圖是使用Matplotlib
for x, group in graph:
t = group.plot(x="CompressorSpeed", y="ratio", marker='o').set_title(x)
plt.annotate('This is awesome', xy=(**i**, **j**), arrowprops=dict(arrowstyle="->"))
plt.savefig(pp, format="pdf")
凡圖是(和csvdata
是從read_csv(...)
創建熊貓數據框對象)
graph=csvdata.groupby("CompressorAlgo", as_index=False)
我可以驗證一個xy
標籤如果創建的話我硬編碼一個已知點。
這裏是一個標誌點一份附圖片:
點是數據框中的數據。你想標記每個數據點嗎?請參閱http://matplotlib.org/devdocs/users/annotations.html – tacaswell
只要我們不知道您想用哪種標準來標記您的觀點,我擔心我們無法幫助您。 – ImportanceOfBeingErnest
我指的是圖中創建的'marker'點。我附上了一張照片('marker'點是較大的圓點)。 – BlazePascal