Hi,
I have an ImageView which resides in a PlotItem (for the grid) and want to
draw a number of IsoCurveItems on the ImageItem like in the IsoCurveItem
example file. The image is about 1000 x 1000 px. Adding the IsoCurveItems
seems to be very slow. I put a
QApplication.processEvents()
in the loop and can literally watch the curves appear one after another. Is
there a way to speed things up for larger number of curves?
Thanks...
Here is some test code:
from pyqtgraph.Qt import QtGui, QtCore, QtWidgets
import numpy as np
import pyqtgraph as pg
app = QtGui.QApplication([])
m = n = 1000
x, y = np.meshgrid(range(m), range(n))
data = (x - m / 2) ** 2 + (y - n / 2) ** 2
win = pg.GraphicsWindow()
vb = win.addViewBox()
img = pg.ImageItem(data)
vb.addItem(img)
for level in np.linspace(data.min(), data.max(), 11)[1:-1]:
c = pg.IsocurveItem(data=data, level=level, pen=(0, 0, 0))
c.setParentItem(img)
QtWidgets.QApplication.processEvents()
if __name__ == '__main__':
app.exec_()
--
You received this message because you are subscribed to the Google Groups
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/73a3f4d7-e054-4d95-a0a2-ca8a7ef8a84f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.