如在here和here上閱讀,它們使用format_coord
來禁用座標或從工具欄更改格式。 在鏈接問題中使用axe.format_coord = lambda x, y: ''
,刪除了很好的座標。不過,我也想禁用的像素值:禁用matplot工具欄上的像素值圖
然後我試圖用
axe.format_coord = lambda x, y,z:''
但給了一個錯誤:
s = event.inaxes.format_coord(event.xdata, event.ydata)
TypeError: <lambda>() takes exactly 3 arguments (2 given)
請幫我解決這個問題。
fig.canvas.toolbar.set_message = lambda x: ""
:
'axe.format_coord'之前的值是什麼? –
從錯誤中可以看出,不能使用'z'作爲附加參數,因爲lambda函數總是用2個參數('x','y')調用。 – ImportanceOfBeingErnest
以前的值是'axe.format_coord = lambda x,y:'''完美的工作,因爲我也想禁用工具欄上的座標 – Ivan