[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave's plotting much slower than matlab

From: Michael Goffioul
Subject: Re: Octave's plotting much slower than matlab
Date: Tue, 22 Jan 2008 11:17:31 +0100

On Jan 22, 2008 1:58 AM, David Bateman <address@hidden> wrote:
> 1) What should be done if the user gives NaN data in the patches?
> Without matlab to check, I believe scatter should drop these points,
> though I suppose they might be stored in the handle and dropped at the
> time of plotting.

Matlab seems to drop the NaN points in scatter. The resulting scatterseries
object does not contain the NaN points (if I use 11 points [including 1 NaN],
the scatterseries object has 10 patch children). BTW, I find the Matlab
implementation quite inefficient: 1 point == 1 patch. Maybe we should use
1 patch for all points; as long as we provide a compatible scatterseries object.

As a side note, I see in __patch__.m that you're doing XY <-> Face/Vertex
conversion. Maybe this should be moved to the C++ code, because this
kind of conversion will be needed anyway, to update the patch object when
the user changes something.

> 2) Can we vectorize the for-loop and at least get reasonable speed for
> scatter with a SVN head version of JHandles? I think we can, but the
> only means I saw to do it is quite messy. See the attached patch.

I tried your patch and the improvement is huge:

octave.exe:7> tic, scatter(rand(1,1000),rand(1,1000)), toc
Elapsed time is 0.541099 seconds.
octave.exe:8> close
octave.exe:9> tic, scatter(rand(1,10000),rand(1,10000)), toc
Elapsed time is 0.622619 seconds.
octave.exe:10> close
octave.exe:15> tic, scatter(rand(1,100000),rand(1,100000)), toc
Elapsed time is 0.972446 seconds.

I could not use 300k points, because Java ran out of memory
(I could increase it, but I didn't try).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]