I use Spyder (from Anaconda)(Python 3.6 and PyQt5). Try to run something like this:
from PyQt5 import uic,QtWidgets,QtGui
import numpy as np
form_class = uic.loadUiType("yourUIfile.ui")[0]
class MyWindowClass(QtWidgets.QMainWindow,form_class):
def __init__(self, parent=None):
QtWidgets.QMainWindow.__init__(self, parent)
self.setupUi(self)
# here you can properties of your graph widget.... for example:
self.GraphWidgetName.setTitle('My Graph')
self.GraphWidgetName.setLabel('bottom', 'X axis')
self.GraphWidgetName.setLabel('left', 'Y axis')
plotexample()
def plotexample(self):
a=np.array([1,2,3,4,5])
b=np.array([6,7,8,9,10])
self.GraphWidgetName.plot(a,b)
self.GraphWidgetName.showGrid(x=True, y=True)
if __name__=="__main__":
app = QtWidgets.QApplication(sys.argv)
MyWindow = MyWindowClass(None)
MyWindow.show()
app.exec_()
I made this right now, please try it and tell me if this works for you, dont forget to change the name like "yourUIfile.ui" for the names of the files you have. In my case i didn't have to import pyqtgraph library because the widget already have the properties of pyqtgraph (this only if you promoted QGraphicsView Widget correctly). Well if this dont works try adding "import pyqtgraph" at the start of the script. Good Luck...
Alejandro
PD: English is not my mother language, i hope you will understand what i wrote.