Note that there are some explanatory texts on larger screens.

plurals
  1. POScatter plot in pylab: arranging axis and data
    primarykey
    data
    text
    <p>I'm trying to put together a scatter plot in pylab and so far have failed miserably. I'm not a programmer as such, so please bear with me. </p> <p>I have a data set composed of two columns of data contained in a csv file with around 60k lines. Here's a sample:</p> <pre><code>100000000012640,0.888888888888889 100000000105442,0.777777777777778 100000000206866,1.0 100000000304930,0.777777777777778 100000000583236,0.888888888888889 100000000683528,0.777777777777778 718435316,1.0 718494043,0.777777777777778 718602951,0.777777777777778 718660499,0.777777777777778 718766852,1.0 718795104,1.0 718862926,0.777777777777778 718927526,0.777777777777778 718952836,1.0 719102865,0.777777777777778 719156726,1.0 719213511,1.0 719425334,1.0 719452158,1.0 719493947,0.777777777777778 719566609,1.0 720090346,0.777777777777778 720127760,0.777777777777778 720143948,0.944444444444444 720221566,1.0 720256688,0.944444444444444 720349817,0.777777777777778 720380601,0.777777777777778 720446322,1.0 720524740,1.0 720560353,1.0 720594066,0.777777777777778 720673388,1.0 720716865,0.777777777777778 720730249,1.0 720774433,1.0 </code></pre> <p>My goal is to draw a scatter plot of this data, with the first row of data on the x axis and the second row on the y axis. The values for the x axis are sorted in descending order, start at the values shown and end at 999963505. The values for the y axis are always between 0 and 1.</p> <p>Here's what I've tried (using "ipython --pylab"):</p> <pre><code>data = loadtxt('./data/OD-4322/facebookID.csv', unpack=True, dtype=('float', 'float'), delimiter=',') scatter(data[0],data[1]) </code></pre> <p>This gets me something that resembles a scatter plot, but not quite what I'm looking for:</p> <p><a href="http://content.screencast.com/users/FernandoGarridoVaz/folders/Jing/media/a0df81c5-2dbb-4e93-8e18-3c9db07728f5/00000793.png" rel="nofollow">http://content.screencast.com/users/FernandoGarridoVaz/folders/Jing/media/a0df81c5-2dbb-4e93-8e18-3c9db07728f5/00000793.png</a></p> <p>(I would post the image directly but my reputation in the site does not allow it yet).</p> <p>How can I make this so that the x axis are in the same range as my values? Why are the points in my plot all piled up on 0 and 1, when in truth they are distributed all over the place between 0 and 1?</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.
    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