Note that there are some explanatory texts on larger screens.

plurals
  1. POScatter plot of 10k record extracted from database
    text
    copied!<p>I am trying to make a scatter plot in Python. I supposed it will be fairly simple but got stuck with understanding in scatterplot (x and y value) while plotting.</p> <p>==<strong>My mission</strong> ==</p> <ul> <li>I have database and more then 10k record (all float) till now and will increase on daily basis.</li> <li>The record range is from 200-2000 (in float decimal).</li> <li>So, I want to see the most populated region in my dataset.</li> </ul> <p>==<strong>What I did?</strong>==</p> <pre><code>import numpy as np import pylab as pl import MySQLdb import sys import math conn = MySQLdb.connect( host="localhost", user="root", passwd="root", db="myproject") with conn: cur = conn.cursor() #will fetch all recoreds called monoiso field cur.execute("SELECT monoiso FROM pmass_selectedion") rows = cur.fetchall() for row in rows: #xvalue for monoiso variable and yvalue for range xvalue = row yvalue = [600] # tried this way too but got x and y dimension error #yvalue = [400,800,1200,1600] pl.plot(xvalue,yvalue,'ro') pl.show() </code></pre> <p><strong>Scatterplot Understanding</strong> (<a href="http://stattrek.com/ap-statistics-1/scatterplot.aspx" rel="nofollow noreferrer">link</a>)</p> <p><img src="https://i.stack.imgur.com/2T2qq.png" alt="enter image description here"></p> <p><strong>Ok! this plot doesnt make any sense.</strong></p> <p>==<strong>Question</strong> ==</p> <ul> <li>How to make scatter plot to see the most populated region?</li> <li>How can I assign y variable to make equal dimension with x variable(total number of fetched records)?</li> </ul> <p>New to plotting and statistic so please help me out</p>
 

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