matplotlib slow for rendering

I completely agree with Alexander Mont.

From: Alexander Mont <alexmont1@...903...>
"Test results"
2005-11-23 19:34

Matplotlib is currently too slow to render large
datasets. This needs improvement. Is anyone
working on this problem? I believe this issue
was also brought up at the last SciPy...

···

---

Mike McKerns
242A Keck Laboratory MC138-78
California Institute of Technology
TEL: (626)395-5773 or (626)590-8470
FAX: (626)795-6132
http://www.its.caltech.edu/~mmckerns
mmckerns@...256...

It would help if you were more specific. Are you referring to
animation or static images? I can generate a million point scatter
plot in under a minute, and I would consider this pretty good for a
general purpose plotting package.

- Charlie

···

On 12/1/05, Michael McKerns <mmckerns@...902...> wrote:

I completely agree with Alexander Mont.

> From: Alexander Mont <alexmont1@...903...>
> "Test results"
> 2005-11-23 19:34

Matplotlib is currently too slow to render large
datasets. This needs improvement. Is anyone
working on this problem? I believe this issue
was also brought up at the last SciPy...

---

Mike McKerns
242A Keck Laboratory MC138-78
California Institute of Technology
TEL: (626)395-5773 or (626)590-8470
FAX: (626)795-6132
http://www.its.caltech.edu/~mmckerns
mmckerns@...256...

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Hi matplotlib'ers!
while the end result in matplotlib is starting to "get there", the speed is
not yet where it has to be to be useful IMO. I hereby post a little challenge
for the matplotlib developers;

get the actual plotting time (from the first plot command until show is done)
on the below dataset down to less than a second,(including the quiver
command in the plot.py file).

download the 3 files here (ca 600kb in total)

http://www.ii.uib.no/~avle/slow1/

execfile('plot.py') to plot the dataset (works for me with cvs as of today).
the first part of the file is just some convenience funcs for loading
the data. the plotting happen near the end.

this is a moderately sized grid, 433x560 cells (those of you into
oceanography may recognize the area). what I observe on my pentium
2.54ghz linux box:

-after "data ok" on screen, it takes ca15s to render. pygist uses < 0.5s
-zoom operations take ca 5s. pygist is "instant".
-you don't want to wait for an additional quiver layer. it must take
minutes to finish. pygist is instant. with quiver, also zooming is
equally slow, the ui freeze for ages.
-often one wants to add contours from other fields on top of this, in
pygist this adds no
visible delay, matplotlib easily doubles the rendering time.

typical usage for me is to load many such datasets, and do a lot of
zoom in/out/pan to various features, modify colors/levels, add
velocity vectors etc. currently this is quite
painful in matplotlib, as one zoom operation on realistic datasets
easily takes 10 seconds on a multi ghz machine. pygist is very fast,
even on a 400mhz laptop, memory usage is also a lot lower.

so, I think matplotlib is a great effort, and shows a lot of promise, but
for realistic use, it is (at least for me) still far too slow!

Helge

···

On 12/1/05, Charlie Moad <cwmoad@...287...> wrote:

     It would help if you were more specific. Are you referring to
animation or static images? I can generate a million point scatter
plot in under a minute, and I would consider this pretty good for a
general purpose plotting package.

Hi,

I tried that but got:
python plot.py
file h433x560.gz loaded and given shape (433, 560)
data ok
Traceback (most recent call last):
  File
"/usr/lib/python2.3/site-packages/matplotlib/backends/backend_qtagg.py", line
75, in paintEvent
    FigureCanvasAgg.draw( self )
  File "/usr/lib/python2.3/site-packages/matplotlib/backends/backend_agg.py",
line 383, in draw
    self.figure.draw(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/figure.py", line 520, in
draw
    for a in self.axes: a.draw(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/axes.py", line 1441, in
draw
    self.yaxis.draw(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/axis.py", line 562, in
draw
    tick.draw(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/axis.py", line 162, in
draw
    if self.label2On: self.label2.draw(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/text.py", line 854, in
draw
    self._mytext.draw(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/text.py", line 339, in
draw
    bbox, info = self._get_layout(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/text.py", line 264, in
_get_layout
    xys = [self._transform.inverse_xy_tup( xy ) for xy in zip(tx, ty)]
RuntimeError: Transformation is not invertible
Traceback (most recent call last):
  File
"/usr/lib/python2.3/site-packages/matplotlib/backends/backend_qtagg.py", line
75, in paintEvent
    FigureCanvasAgg.draw( self )
  File "/usr/lib/python2.3/site-packages/matplotlib/backends/backend_agg.py",
line 383, in draw
    self.figure.draw(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/figure.py", line 520, in
draw
    for a in self.axes: a.draw(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/axes.py", line 1441, in
draw
    self.yaxis.draw(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/axis.py", line 562, in
draw
    tick.draw(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/axis.py", line 162, in
draw
    if self.label2On: self.label2.draw(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/text.py", line 854, in
draw
    self._mytext.draw(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/text.py", line 339, in
draw
    bbox, info = self._get_layout(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/text.py", line 264, in
_get_layout
    xys = [self._transform.inverse_xy_tup( xy ) for xy in zip(tx, ty)]
RuntimeError: Transformation is not invertible
Traceback (most recent call last):
  File
"/usr/lib/python2.3/site-packages/matplotlib/backends/backend_qtagg.py", line
75, in paintEvent
    FigureCanvasAgg.draw( self )
  File "/usr/lib/python2.3/site-packages/matplotlib/backends/backend_agg.py",
line 383, in draw
    self.figure.draw(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/figure.py", line 520, in
draw
    for a in self.axes: a.draw(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/axes.py", line 1441, in
draw
    self.yaxis.draw(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/axis.py", line 562, in
draw
    tick.draw(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/axis.py", line 162, in
draw
    if self.label2On: self.label2.draw(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/text.py", line 854, in
draw
    self._mytext.draw(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/text.py", line 339, in
draw
    bbox, info = self._get_layout(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/text.py", line 264, in
_get_layout
    xys = [self._transform.inverse_xy_tup( xy ) for xy in zip(tx, ty)]
RuntimeError: Transformation is not invertible
QWidget (QWidget figure): deleted while being painted
QPaintDevice: Cannot destroy paint device that is being painted

Any hint how to solve this? My installation:
FC3
matplotlib-0.85
PyQt-3.15-0.1.fc3.kde
PyQt-qscintilla-3.15-0.1.fc3.kde
python-2.3.4-13.1
scipy_version: '0.3.2'

Thanks,
wr

···

Am Freitag, 2. Dezember 2005 20:48 schrieb Helge Avlesen:

On 12/1/05, Charlie Moad <cwmoad@...287...> wrote:
> It would help if you were more specific. Are you referring to
> animation or static images? I can generate a million point scatter
> plot in under a minute, and I would consider this pretty good for a
> general purpose plotting package.

Hi matplotlib'ers!
while the end result in matplotlib is starting to "get there", the speed is
not yet where it has to be to be useful IMO. I hereby post a little
challenge for the matplotlib developers;

get the actual plotting time (from the first plot command until show is
done) on the below dataset down to less than a second,(including the quiver
command in the plot.py file).

download the 3 files here (ca 600kb in total)

http://www.ii.uib.no/~avle/slow1/

execfile('plot.py') to plot the dataset (works for me with cvs as of
today). the first part of the file is just some convenience funcs for
loading the data. the plotting happen near the end.

this is a moderately sized grid, 433x560 cells (those of you into
oceanography may recognize the area). what I observe on my pentium
2.54ghz linux box:

-after "data ok" on screen, it takes ca15s to render. pygist uses < 0.5s
-zoom operations take ca 5s. pygist is "instant".
-you don't want to wait for an additional quiver layer. it must take
minutes to finish. pygist is instant. with quiver, also zooming is
equally slow, the ui freeze for ages.
-often one wants to add contours from other fields on top of this, in
pygist this adds no
visible delay, matplotlib easily doubles the rendering time.

typical usage for me is to load many such datasets, and do a lot of
zoom in/out/pan to various features, modify colors/levels, add
velocity vectors etc. currently this is quite
painful in matplotlib, as one zoom operation on realistic datasets
easily takes 10 seconds on a multi ghz machine. pygist is very fast,
even on a 400mhz laptop, memory usage is also a lot lower.

so, I think matplotlib is a great effort, and shows a lot of promise, but
for realistic use, it is (at least for me) still far too slow!

Helge

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log
files for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&opÌk
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Gruss,
wr

--
Dipl.-Inform. Willi Richert
C-LAB - Cooperative Computing & Communication Laboratory
der Universität Paderborn und Siemens

FU.323
Fürstenallee 11
D-33102 Paderborn
Tel: +49 5251 60 6120
Fax: +49 5251 60 6165
http://www.c-lab.de

so you got the data loaded, try commenting out one of the below lines
near the end until you see something, you probably hit a bug in one of
the qt routines

...
hsv()
contourf(x, y, h, levels)
colorbar(clabels=levels[::8])
axis([0, im, 0, jm] )
axis('scaled')
pldj(seg)
...
I use the gtk backend btw.

Helge

···

On 12/3/05, Willi Richert <w.richert@...361...> wrote:

Hi,

I tried that but got:
python plot.py
file h433x560.gz loaded and given shape (433, 560)
data ok