octave-maintainers
[Top][All Lists]
Advanced

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

Re: fast scatter plots - advice sought


From: Jaroslav Hajek
Subject: Re: fast scatter plots - advice sought
Date: Mon, 11 Jan 2010 21:22:11 +0100

On Mon, Jan 11, 2010 at 7:35 PM, John W. Eaton <address@hidden> wrote:
> On 11-Jan-2010, Robert T. Short wrote:
>
> | The way things are done now, scatter is useless for more than a very
> | small number of points and I think MATLAB compatibility should be
> | dropped if uselessness is the result of compatibility.  However, it
> | sounds like we are NOT currently compatible with MATLAB and becoming
> | compatible might fix the problem.
>
> I think all that needs to be done at this point to make it compatible
> and faster is to change the breakpoint to 100

I disagree with that. The value of 100 is not documented anywhere and
can probably be changed anytime by some MathWorks developer that will
adjust the code. I think it's a plain nonsense to pursue Matlab
compatibility to this extent.

> and use patch instead of
> line objects.
>

This is similar. The documentation  doesn't seem to say anything about
patch objects. To me, it seems logical to use the simplest primitive
capable of plotting a set of points, which I think is a line. Are
patches somehow faster or otherwise superior to lines? If yes, why?

> Also, I'm seeing the following now:
>
>  lt-octave:3> n = 2000; x = randn (n, 1); y = randn (n, 1); scatter (x, y, 
> hypot (x, y), [])
>  error: unique_idx: subscript indices must be either positive integers or 
> logicals.
>  error: called from:
>  error:   /home/jwe/src/octave/scripts/plot/private/__scatter__.m at line 
> 224, column 7
>  error:   /home/jwe/src/octave/scripts/plot/private/__scatter__.m at line 
> 247, column 12
>  error:   /home/jwe/src/octave/scripts/plot/private/__scatter__.m at line 
> 162, column 9
>  error:   /home/jwe/src/octave/scripts/plot/scatter.m at line 70, column 7
>
> The problem seems to be the following code in the unique_idx function:
>
>    [xx, idx] = sort (x);
>    n = length (x);
>    jdx = find (xx(1:n-1,:) != xx(2:n,:));
>    jdx(n) = n;
>    y = xx(jdx);
>
> If the length of jdx as returned by find is less than n, then setting
> jdx(n) = n will fill with zeros and the following index expression
> fails with the above error.  I'm not sure of the intent here, so I'm
> not sure of the appropriate fix.
>

Sorry, I forgot to push the fix for this.


-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



reply via email to

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