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.
==My mission ==
- I have database and more then 10k record (all float) till now and will increase on daily basis.
- The record range is from 200-2000 (in float decimal).
- So, I want to see the most populated region in my dataset.
==What I did?==
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()
Scatterplot Understanding (link)

Ok! this plot doesnt make any sense.
==Question ==
- How to make scatter plot to see the most populated region?
- How can I assign y variable to make equal dimension with x variable(total number of fetched records)?
New to plotting and statistic so please help me out
Perhaps you are looking for a matplotlib histogram:
You can also make a histogram/dot-plot by using numpy.histogram:
Regarding the use of pylab: The docstring for pyplot says