The following is an adaptation of the previous code for use in PyQt5 and Matplotlib 2.0 . There are a number of small changes: the structure of the PyQt submodules, another submodule from matplotlib, the deprecated method has been replaced ...
import sys from PyQt5.QtWidgets import QDialog, QApplication, QPushButton, QVBoxLayout from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar import matplotlib.pyplot as plt import random class Window(QDialog): def __init__(self, parent=None): super(Window, self).__init__(parent)
Anabar Mar 13 '17 at 22:08 2017-03-13 22:08
source share