Note that there are some explanatory texts on larger screens.

plurals
  1. POplot a huge amount of data points
    primarykey
    data
    text
    <p>I have encountered a strange problem: when I store a huge amount of data points from a nonlinear equation to 3 arrays (x, y ,and z) and then tried to plot them in a 2D graph (theta-phi plot, hence its 2D). </p> <p>I tried to eliminate points needed to be plotted by sampling points from every 20 data points, since the z-data is approximately periodic. I picked those points with z value just above zero to make sure I picked one point for every period. </p> <p>The problem arises when I tried to do the above. I got only a very limited number of points on the graph, approximately 152 points, regardless of how I changed my initial number of data points (as long as it surpassed a certain number of course). <img src="https://i.stack.imgur.com/fUdke.png" alt="graph"></p> <p>I suspect that it might be some command I use wrongly or the capacity of array is smaller then I expected (seems unlikely), could anyone help me find out where is the problem?</p> <pre><code>def drawstaticplot(m,n, d_n, n_o): counter=0 for i in range(0,m): n=vector.rungekutta1(n, d_n) d_n=vector.rungekutta2(n, d_n, i) x1 = n[0] y1 = n[1] z1 = n[2] if i%20==0: xarray.append(x1) yarray.append(y1) zarray.append(z1) for j in range(0,(m/20)-20): if (((zarray[j]-n_o)&gt;0) and ((zarray[j+1]-n_o)&lt;0)): counter= counter +1 print zarray[j]-n_o,counter plotthetaphi(xarray[j],yarray[j],zarray[j]) def plotthetaphi(x,y,z): phi= math.acos(z/math.sqrt(x**2+y**2+z**2)) theta = math.acos(x/math.sqrt(x**2 + y**2)) plot(theta, phi,'.',color='red') </code></pre> <p>Besides, I tried to apply the code in the following <a href="https://stackoverflow.com/questions/4082298/scatter-plot-with-a-huge-amount-of-data">SO question</a> to my code, I want a very similar result except that my data points are not randomly generated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload