[Bugfix]Plot: reintroduce patch removed by #9103

While FC don't depend on PyQt anymore, patch is needed to have
 matplotlib working correctly

 935994dd2d (r108628060)
This commit is contained in:
0penBrain
2023-04-26 18:51:58 +02:00
committed by Adrián Insaurralde Avalos
parent 5af2a3c07a
commit da53a97bf3

View File

@@ -30,7 +30,13 @@ try:
import matplotlib
matplotlib.use('Qt5Agg')
import matplotlib.pyplot as plt
# Force matplotlib to use PySide backend by temporarily unloading PyQt
if 'PyQt5.QtCore' in sys.modules:
del sys.modules['PyQt5.QtCore']
import matplotlib.pyplot as plt
import PyQt5.QtCore
else:
import matplotlib.pyplot as plt
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar