I implemented the matplotlib plots and navigation toolbar in pyqt4 GUI. How do I change the background color of "Figure options" in the toolbar?
In the above picture with a gray background, everything looks good. The same "Figure options" with a dark background looks like the figure below
How do I change the background color of the "Figure options?"
The navigation toolbar is implemented in the following way
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
self.figure = Figure(figsize=(6,7))
self.canvas = FigureCanvas(self.figure)
self.toolbar = NavigationToolbar(self.canvas, self)
I figured it out. The simple solution is to add self.toolbar.setStyleSheet("background-color:Gray;")
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.