简体   繁体   中英

Matplotlib pyqt Navigation toolbar change background color of “figure options”

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM