[Python] pyqtgraph plots and axes are flickering - rendering issue

Discussão em 'Python' iniciado por Stack, Julho 14, 2025.

  1. Stack

    Stack Membro Participativo

    I am using pyqtgraph but whatever I am doing I am stuck with the following bug: for any plots, axes and plot is flickering and I cannot see anything. I put a GIF to show my problem and the corresponding code

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

    app = QApplication(sys.argv)

    win = QMainWindow()
    plot_widget = pg.PlotWidget()
    win.setCentralWidget(plot_widget)

    x = np.linspace(0, 10, 1000)
    y = np.sin(x)
    plot_widget.plot(x, y)

    win.show()
    sys.exit(app.exec())



    os : Ubuntu 22.04.5 LTS.
    Python env:

    • Python 3.10.13
    • pyqtgraph, Version: 0.13.7
    • PySide6, Version: 6.9.1
    • numpy, Version 2.2.6

    I assume it is a rendering issue related to the system and not Python or code logic since I tried using code from basic tutorial which led to different output than the one expected in the tutorial (ex. first plot of this page)

    I tried several backend by setting QT_QPA_PLATFORM env variable to xcb or wayland but did not work.

    I tried this settings at the begining of my script, but it did not work.

    os.environ["QT_QPA_PLATFORM"] = "xcb"
    os.environ["QT_OPENGL"] = "software"
    os.environ["LIBGL_ALWAYS_SOFTWARE"] = "1"


    Link to the gif https://gifyu.com/image/bKIQU

    Continue reading...

Compartilhe esta Página