Plotting multiline graph with large dataset (6 lines, about 30, 000, 000 points total

Hello Krishna,

This is really crazy ploting so many data point, after all the human
eye can't separate all the data.
Try sampling the vector of the data point - to a smaller extent.

Here's a quick and dirty solution how to sample every nth element in a
vector - there's probably a faster way, with out loops, but this works
for now

$ python
Python 2.5.5 (r255:77872, Feb 1 2010, 19:53:42)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

from nupmy import arange

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named nupmy

from numpy import arange
a=arange(1,15)
a

array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14])

from numpy import zeros
a_sampled=zeros(5)
a_sampled

array([ 0., 0., 0., 0., 0.])

range(0,15,5)

[0, 5, 10]

range(0,15,3)

[0, 3, 6, 9, 12]

fileter_indecies=range(0,15,3)
for i in range(len(a_sampled)):

... a_sampled[i]=a[fileter_indecies[i]]
...

a_sampled

array([ 1., 4., 7., 10., 13.])

I hope it helps

···

--
Oz Nahum
Graduate Student
Zentrum für Angewandte Geologie
Universität Tübingen

---

Imagine there's no countries
it isn't hard to do
Nothing to kill or die for
And no religion too
Imagine all the people
Living life in peace

Oz Nahum wrote:

Here's a quick and dirty solution how to sample every nth element in a
vector - there's probably a faster way, with out loops,

there sure is:

In [8]: orig
Out[8]:
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
        17, 18, 19])

In [9]: orig[0:-1:4] # every 4th element
Out[9]: array([ 0, 4, 8, 12, 16])

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

Following up on Oz's point ...
let's suppose that is 5M points for each of the 6 lines,
and that you will try to place them on a 5 inch wide axis.
That is 1M plotted points per horizontal inch.
Here is a list of typical monitor pixel densities:
http://en.wikipedia.org/wiki/List_of_displays_by_pixel_density

Alan Isaac

···

On 2/10/2010 1:17 PM, Oz Nahum wrote:

This is really crazy ploting so many data point, after all the human
eye can't separate all the data.