I've been developing a tkinter app, which has a matplotlib graph embeded in it. The problem i am having right now is :
Allthough the functionality of the toolbar is working, it doesnt change the cursor which makes a worse user experience since you cant tell if you are zooming or not. From what i have seen from various documentation and online tutorials this shouldnt be an issue.
From what i read, the toolbar should even makes changing cursor harder, since it overrides to cursor all the time when pan or zoom is selected. I am posting the related parts of my code, please let me know if you see something that doesnt add up, or anything that i might be missing.
Any suggestion is much appriciated!
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
class Controller(tk.Tk):
self.canvass = FigureCanvasTkAgg(self.plots, self)
self.canvass.show()
self.canvass.get_tk_widget().grid(row=1, column=0, sticky="news")
self.toolbar_frame = tk.Frame(self, width=410, height=30)
self.toolbar_frame.config(relief="sunken", borderwidth=1)
self.toolbar_frame.pack_propagate(flag=False)
self.toolbar_frame.grid(column=0, row=3, sticky="w")
self.toolbar = NavigationToolbar2TkAgg(self.canvass, self.toolbar_frame)
self.toolbar.pack()
self.toolbar.update()
It turned out putting the toolbar into a frame causes that weird behavior. I just took a simple 'matplotlib in tkinter embedding' example which was working and modified it to use a frame as i did in my code, and the same problem occoured.
I need the frame because normally the toolbar uses pack and i dont want to change the whole layout just because of this, since i'have used grid all along.