[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Octave's plotting much slower than matlab
From: |
David Bateman |
Subject: |
Re: Octave's plotting much slower than matlab |
Date: |
Mon, 21 Jan 2008 14:17:40 +0100 |
User-agent: |
Thunderbird 1.5.0.7 (X11/20060921) |
Thomas Ilnseher wrote:
> Hi!
>
> I did the following:
>
> f=fopen('scatter.txt', 'r');
> [v c] = fscanf(f, '%d', [2, inf]);
> fclose(f);
> scatter(v(1,:), v(2,:));
>
>
> v will contain 300k points. This takes ' a few ' seconds in Matlab.
> In Octave however, I did press control-C, and afterwards used:
>
> scatter(v(1,1:2000), v(2,1:2000));
>
> which still took longer than in matlab.
>
> Bottomline: Matlab's plotting is faster by a factor of 100 !!!
>
> Is it gnuplot that I need to blame, the octave scripts to do the
> plotting, or the octave <-> gnuplot interface ?
>
> I suspect it's some .m file, because doing:
>
> octave:11> plot(v(1,:), v(2,:), 'og;hallo;');
> octave:12> legend('off');
>
> is actually _*FASTER*_ than matlab ...
>
Doesn't surprise me given the way that Octave is constrained to
communication with gnuplot for the scatter function. Each point is a
patch object with a single point, and so Octave sends a full gnuplot
plot command to the gnuplot process for each and every point in the
scatter plot.. I suspect that this is one function that will be vastly
accelerated by the change to a different graphics backend. However, it
doesn't appear that JHandles handles the patch with a single point or
unclosed patches, and so its no use for your case.. All I can offer is,
we're working on it..
D.
--
David Bateman address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary