Skip to content

Program loops indefinitely when I start an application with plot set on autosampling. #2713

@Mriv31

Description

@Mriv31

Short description

When I start a pyqtgraph application with a plot with auto Downsampling, it loops over different values of the downsampling parameter and then crashes. I also have remarks about the optimization of the Downsampling but will put them in a discussion.

Code to reproduce

import pyqtgraph as pg
from PyQt6 import QtCore, QtWidgets

import numpy as np
pp = pg.mkQApp()
mw = QtWidgets.QMainWindow()
mw.setWindowTitle('pyqtgraph example: PlotWidget')
mw.resize(800,800)
cw = QtWidgets.QWidget()
mw.setCentralWidget(cw)
l = QtWidgets.QVBoxLayout()
cw.setLayout(l)

pw = pg.PlotWidget()  ## giving the plots names allows us to link their axes together
pw.setClipToView( True)
pw.enableAutoRange(False)
pw.setDownsampling( ds=None, auto=1, mode="subsample")
l.addWidget(pw)
data = np.arange(10000000)+np.random.normal(0,10,10000000)
pw.plot(data, title="Simplest possible plotting example")
mw.show()

if __name__ == '__main__':
    pg.exec()

Expected behavior

Real behavior

The program loops. When I print the "ds" parameter, it goes down until the program crashes.

Tested environment(s)

  • PyQtGraph version: 0.13.3
  • Qt Python binding: PyQt6
  • Python version: Python 3.10
  • NumPy version: 1.21.5
  • Operating system: Ubuntu
  • Installation method: pip

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions