1

I am trying the example from PythonGUIs website using this script:

from PySide6.QtWidgets import QApplication, QMainWindow
import pyqtgraph as pg
import sys

class MainWindow(QMainWindow):

    def __init__(self):
        super().__init__()

        self.graphWidget = pg.PlotWidget()
        self.setCentralWidget(self.graphWidget)

        hour = [1,2,3,4,5,6,7,8,9,10]
        temperature = [30,32,34,32,33,31,29,32,35,45]

        # plot data: x, y values
        self.graphWidget.plot(hour, temperature)


app = QApplication(sys.argv)
w = MainWindow()
w.show()
app.exec()

For some reason its just giving me a blank ui plot

Are the versions not compatible or is there something wrong somewhere?

Versions:

Python = 3.13.5

pyqtgraph = 0.13.7

PySide6 = 6.9.1

3
  • code works for me on Linux Mint. It also works if I use PyQt6 instead of PySide6. Python 3.13.5, PyQt6 6.8.1, PySide6 6.8.2.1, pyqtgraph 0.13.7 Commented Jun 25 at 10:00
  • 1
    do you get any error messages or warnings when you run it in console? Commented Jun 25 at 10:01
  • theres no error messages or warnings Commented Jun 26 at 0:35

2 Answers 2

4

It is a bug with PySide 6.9.1 (see the report: PYSIDE-3115). It's already marked as fixed for the forthcoming 6.9.2 and future 6.10.

That specific version has been blacklisted for pyqtgraph a few days ago.

PySide 6.9.1 should be avoided and considered as unreliable/unstable due to this issue. If you can, at the very least downgrade to 6.9.0.
The 6.8 branch doesn't seem to be affected since the change causing the problem was introduced in the 6.9 branch, so you may consider downgrading to 6.8.3 as well (being it a higher patch/build version of a minor version, it is probably more stable and reliable than a 0 patch/build version of a higher minor one). Be aware, though, that that change was caused by another bug found in 6.8.3, probably existing in previous versions too.

For simple usage, both downgrade options may be acceptable depending on your needs, but the criticality of the related bugs should also be considered along with that of new features and changes introduced since 6.9.

PyQt doesn't seem to be affected, therefore you can try to install it as an alternative. If you really need PySide and cannot downgrade, you can still use PyQt temporarily, until PySide 6.9.2 is officially released (due in a couple of months).

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you so much! Yes, there is a bug with PySide6.9.1 with plotting. I tried downgrading to 6.9.0 and it worked now. Appreciate it
@rawks You're welcome! I've updated the post based on your report; to clarify, the bug isn't just about plotting, it's specifically a PySide (and quite serious) one, even though caused by relatively uncommon situations (triggered by the complexity of pyqtgraph). Be aware that the 6.9.1 change was done as consequence of another bug, therefore you may have different issues with 6.9.0 or 6.8.* as well. You'll probably be fine for generic/simple usage, but upgrade to 6.9.2 as soon as it's out: it's currently expected for mid-August, but September is more likely.
2

I had the same problem. It worked by using using Pyside6 6.8.x instead of Pyside6 6.9.x.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.