As read on here and here, they use format_coord
to disable coordinates or change format from the toolbar.
Using axe.format_coord = lambda x, y: ''
as in the linked question, removed the coordinates, which is fine. However, I also want to disable the value of pixels:
I then tried to use
axe.format_coord = lambda x, y,z:''
but that gave an error:
s = event.inaxes.format_coord(event.xdata, event.ydata)
TypeError: <lambda>() takes exactly 3 arguments (2 given)
Please help me to fix it.
In order to suppress any output in the status bar of the figure window, one may replace the figure toolbar's message method (NavigationToolbar2
's .set_message
) with a lambda function that returns an empty string:
fig.canvas.toolbar.set_message = lambda x: ""
Complete example:
import matplotlib.pyplot as plt
import numpy as np
fig, ax = plt.subplots()
ax.imshow(np.random.rand(5,5))
fig.canvas.toolbar.set_message = lambda x: ""
plt.show()