help-octave
[Top][All Lists]
Advanced

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

how to improve sequence plotting speed (to get more fluent animation)?


From: Dr.-Ing. Torsten Finke
Subject: how to improve sequence plotting speed (to get more fluent animation)?
Date: Sat, 3 Apr 2010 05:07:13 +0200
User-agent: Mutt/1.5.16 (2007-06-09)

Hello, 

maybe I'm wrong but I feel, that former versions of Octave had a higher speed
in sequence plotting and produced smoother animations. Now I would like to ask, 
how
plotting speed could be improved. 

In order to get an impression of timings, I wrote a simple script (see below) 
for octave
and nearly equvalent for perl and compared the result. While the perl version 
(that
simply run's gnuplot through a primitive pipe) gives a fluent animantion, the
octave version keeps stagnating on every single plot command.

What would my mistake be? 

Any suggestions appretiated. 

Thanks to the Octave developers for their great work.

Best regards


T. Finke

Version Info:
- GNU Octave, version 3.2.4
- G N U P L O T  Version 4.2 patchlevel 5
- Linux 2.6.31.5 i686 (OpenSuSE 11.2) 


### Scripts

Octave: sine.m
# ---
t = [0:100]/5;
s = sin(t) .* exp(-t/5); 
a = [0, 20, -1, 1];
k = 0; 
while k >= 0, 
    plot(t, sin(k) * s);
    axis(a);
    drawnow();
    k = k + 0.1;
end
# ---

Perl: sine.pl
# ---
#!/usr/bin/perl
open GP, "|gnuplot"; 
my @t = map { $_ / 5 } ( 0 .. 100 );
my $k = 0;
while ( $k >= 0 ) {
    my @d = map {"$_\t" . (sin($k)*sin($_)*exp(-$_/5)) . "\n" } @t; 
    print GP "plot [0:20][-1:1] '-' w l\n", @d, "e\n"; 
    $k += 0.1;
}
# ---






-- 

------------------------------------------------------------------------

Dr.-Ing. Torsten Finke                       Amtsgericht Essen HRB 11500
Ingenieurgemeinschaft IgH                    USt-Id.-Nr.: DE 174 626 722
Ges. für Ingenieurleistungen mbH             Geschäftsführung:
Heinz-Bäcker-Str. 34                         Dr.-Ing. S. Rotthäuser
D-45356 Essen                                Dr.-Ing. T. Finke
Tel.: +49 201 / 360-14-17                    Dr.-Ing. W. Hagemeister
Fax.: +49 201 / 360-14-14                    Tel.: +49 201 / 360-14-0
address@hidden                  http://www.igh-essen.com

------------------------------------------------------------------------


reply via email to

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