3

I'm now embedding matplotlib plot in a simple GUI. During the customization of the plot, I found some displaying issues occurred when I added tool bar under the plot using NavigationToolbar2TkAgg. Now I want to disable displaying coordinate at right side of the bottom of plot when mouse moves around the plot, if we add tool bars at the left side of the bottom. Any idea about this?

Thanks in advance.

Update:

For a figure simply drawn by plt.plot(x,y), the coordinates are displayed at left side of the bottom along with mouse moving as tool bars (like "home", "zoom" etc.) are listed at the top by default. It will be much clearer to view the screen shot at google drive here and I highlighted the coordinates in yellow, which one can find at the bottom left of the image. Thanks GWW and jgysland for reminding me.

Elkan
  • 546
  • 8
  • 23
  • Can you post a screen shot of what you mean? – GWW Dec 05 '14 at 16:36
  • @GWW Thanks for your reply. I have updated the question. It's a pity that I can not insert an image because I do not have enough reputations. So I'm sorry for the inconvenience. – Elkan Dec 05 '14 at 17:11
  • 1
    Can you post a screenshot on an image hosting site and link to it? – jgysland Dec 05 '14 at 18:31
  • @jgysland thanks for reminding me. I have added the link to google drive. – Elkan Dec 06 '14 at 04:50

1 Answers1

6

You want the opposite of matplotlib values under cursor, but the solution is the same, you need to over-write the format_coord attribute on the Axes object.

ax.format_coord = lambda x, y: ''

should do the trick where ax is a reference to the axes object you care about.

Another option is to sub-class NavigationToolbar2TkAgg and make the set_message function a no-op

class my_toolbar(NavigationToolbar2TkAgg):
    def set_message(self, msg):
        pass
Community
  • 1
  • 1
tacaswell
  • 84,579
  • 22
  • 210
  • 199