D
D
del4pp2020-06-01 12:07:47
Python
del4pp, 2020-06-01 12:07:47

How to run matplotlib in qgraphicsview?

Hello everyone, there is a plot on matplotlib, how to push it into a pyqt5 element?

ps pyqtgraphics also tried to use it, but x is digital and y is string, and it's not possible to push this into the element. Code below.

xdict = dict(enumerate(a_names))
        win = pg.GraphicsWindow()
        stringaxis = pg.AxisItem(orientation='bottom')
        stringaxis.setTicks([xdict.items()])
        plot = win.addPlot(axisItems={'bottom': stringaxis})
        #curve = plot.plot(list(xdict.keys()),a_values)
        self.graphicsView.plot(list(xdict.keys()), a_values)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MechanicZelenyy, 2020-06-01
@del4pp

Use FigureCanvas, here is an example: qt example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question