I would like to change the color of the toolbar when making a matplotlib figure in tkinter. I have managed to find and change the color of two parts. There is one remaining.
What is the small, grey rectangle I have pointed out? How do I change its color?
CodePudding user response:
It is an empty label. You can get a reference to it via winfo_children
:
print (toolbar.winfo_children()[-2])
# .!navigationtoolbar2tk.!label
And to change its color:
toolbar.winfo_children()[-2].config(background=color)