Re: [Matplotlib-users] Plotting multiline graph with large dataset (6 lines, about 30, 000, 000 points total
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. 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 -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Plotting multiline graph with large dataset (6 lines, about 30, 000, 000 points total
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.bar...@noaa.gov -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] 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 "", line 1, in 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 -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Plotting multiline graph with large dataset (6 lines, about 30, 000, 000 points total)
Hi, I am a beginner with matplotlib. I am trying to analyze huge dataset, the plot would have multiple lines. I am getting memory error (it fails maxing out ~2.5GB on my system). I am assuming there are probably ways to simplify the data, I came across something 'simplify' for 'path', not sure how to use that in my case. My code looks something as shown below (there are 2 ways I tried), as can be seen I am using lists, would converting them to numpy arrays significantly improve things? I am yet to try that. Simplifying function would be best I guess. The values on x-axis are cumulative measures (of memory of each element, element being some basic component in our system) and the y-axis shows percentage (obtained by some-count-of-the-element_times_memory-of-the-element/Sum of these for all elements). If this doesn't make sense, that's ok, the idea is the graph is expected to not contain sudden crests or troughs. Method1: xy_pairs = [x1_vals, y1_vals, x2_vals, y2_vals...] plt.plot(**xy_pairs) Method1: for each_xy_pair: plt.plot(x_vals, y_vals) Both of the above methods don't work. Thanks, Krishna. -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users