Skip to content
Advertisement

How to change color of matplotlib toolbar in tkinter?

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.

My code comes directly from https://matplotlib.org/stable/gallery/user_interfaces/embedding_in_tk_sgskip.html?highlight=embedding%20tk with three additional lines to change colors.

JavaScript

This gives me the window:

Plot window with the bit I still want to change pointed out

What is the small, grey rectangle I have pointed out? How do I change its color?

Advertisement

Answer

It is an empty label. You can get a reference to it via winfo_children:

JavaScript

And to change its color:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement