[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Interesting plot behavior
From: |
Robert T. Short |
Subject: |
Interesting plot behavior |
Date: |
Sat, 11 Apr 2009 15:05:55 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.21) Gecko/20090303 SeaMonkey/1.1.15 |
I use scatter plots regularly in my work, usually with thousands or tens
of thousands of points.
This little script is a trivial example:
N = 2^14;
stddev = 0.1;
q = 2*((floor(4*rand(N,1))-1.5) + i*(floor(4*rand(N,1))-1.5));
n = stddev*(randn(N,1) + i*randn(N,1));
m = q + n;
%scatter(real(m),imag(m), 1, 'g');
plot(real(m),imag(m), ".g;;");
axis("square");
Using scatter and tic/toc, it takes 120 seconds to display 2^14 points
but using plot it is so quick I can't really measure it.
This table gives the times (time until the plot is actually displayed)
as a function of "N"
2^10 3 seconds
2^11 6 seconds
2^12 14 seconds
2^13 41 seconds
2^14 120 seconds
This was done with octave 3.0, but I get similar behavior using the tip
(cloned and built yesterday)
Bob
--
Robert T. Short
PhaseLocked Systems
- Interesting plot behavior,
Robert T. Short <=