Is it hard to use OpenGL in 2D plot?

613 views
Skip to first unread message

Leonid Rumatov

unread,
Dec 4, 2013, 1:31:09 AM12/4/13
to pyqt...@googlegroups.com
Is it hard to use OpenGL in 2D plot?

We got some performance problem with 2d plotting, with big data. 
So, this question appears. 
Meybe, there is easy way - only to change some widget to QGLWidget and the usint of QPainter should kept.

Luke Campagnola

unread,
Dec 5, 2013, 8:48:04 AM12/5/13
to pyqt...@googlegroups.com
There are a few different answers to this question:

1) In 0.9.8, there are automatic downsampling features in PlotItem. Try right click -> Plot Options -> Downsample, then check 'Downsample' and 'Clip to view'. This will greatly expand the number of samples you can work with.

2) Have you tried using pg.setConfigOptions(useOpenGL=True) ? This will cause Qt to use OpenGL internally for rendering. On some platforms this leads to a performance increase, but I have generally been unimpressed by it.

3) Jochen Schroeder has done some work to bring 2D plotting to the existing OpenGL system; you can see his changes here: https://github.com/cycomanic/pyqtgraph/tree/glcamera

4) Ultimately, I hope to use VisPy to bring better GPU acceleration to pyqtgraph, but this is far from complete.


Luke

Слава

unread,
Dec 5, 2013, 10:07:03 PM12/5/13
to Luke Campagnola
Hello, Luke.

Thank you, Luke, I'll try first and second variant.
-- 
You received this message because you are subscribed to a topic in the Google Groups "pyqtgraph" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/pyqtgraph/90vS5ZOSEhA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyqtgraph+...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/CACZXET9gvj1G5VgkPa1bN%3D8zZaNma6V1bEZ%2BFh0Gt6DqLub-DA%40mail.gmail.com.
For more options, visit 
https://groups.google.com/groups/opt_out.



-- 
Best wishes!
 Слава                            
mailto:dondu...@yandex.ru

Samuel Garcia

unread,
Dec 6, 2013, 4:40:16 AM12/6/13
to pyqt...@googlegroups.com
Hi Luke and list,
is there in pg (or do you plan?) a mechanism for plotting very big datasets that cannot be in memory.
For instance we can have a 10Gsample in a hdf5 files, and we want to load chunk by chunk when spannin/zoomin/draging. We never want to see the full window.
For that, we should need a hook or something like that could be call each time the zoom is change to load part of the dataset.
I known that Cyril Rossant already made some proof of concept with vispy with this kind of idea.
Do you plan to integrate such a mechanism in pg ? I would happy to help if you want.

Best,

Samuel
--
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 pyqtgraph+...@googlegroups.com.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Samuel Garcia
Lyon Neuroscience
CNRS - UMR5292 -  INSERM U1028 -  Universite Claude Bernard LYON 1
Equipe R et D
50, avenue Tony Garnier
69366 LYON Cedex 07
FRANCE
Tél : 04 37 28 74 24
Fax : 04 37 28 76 01
http://olfac.univ-lyon1.fr/unite/equipe-07/
http://neuralensemble.org/trac/OpenElectrophy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Luke Campagnola

unread,
Dec 8, 2013, 12:57:29 PM12/8/13
to pyqt...@googlegroups.com
On Fri, Dec 6, 2013 at 4:40 AM, Samuel Garcia <sga...@olfac.univ-lyon1.fr> wrote:
Hi Luke and list,
is there in pg (or do you plan?) a mechanism for plotting very big datasets that cannot be in memory.
For instance we can have a 10Gsample in a hdf5 files, and we want to load chunk by chunk when spannin/zoomin/draging. We never want to see the full window.
For that, we should need a hook or something like that could be call each time the zoom is change to load part of the dataset.
I known that Cyril Rossant already made some proof of concept with vispy with this kind of idea.
Do you plan to integrate such a mechanism in pg ? I would happy to help if you want.

Hi Samuel!

There is nothing in pyqtgraph at present to handle this automatically. However, I have just pushed up an example demonstrating a simple PlotCurveItem subclass that will dynamically load and downsample data from HDF5 with minimal memory usage. See here:


The only thing it is missing is a mechanism for caching the downsampled data. Right now, if you wanted to display the entire data set at once, it would have to re-read all data for every repaint (although it would do so without any memory consumption issues). I suppose a cache would not be too difficult to implement..

Luke
Reply all
Reply to author
Forward
0 new messages