Visualization technique of the Earthquake data

import csv
def setup():
size(700, 500)
with open(“quakes.csv”) as f:
reader = csv.reader(f)
header = reader.next() # Skip the header row.
global magnitudes
magnitudes = []
for row in reader:
magnitude = float(row[4])
magnitudes.append(magnitude)
def draw():
background(78, 119, 186)
scalar=10
x = 60
for magnitude in magnitudes:
leftEdge = x — (magnitude * scalar) / 2
rightEdge = x + (magnitude * scalar) / 2
if leftEdge < mouseX and mouseX < rightEdge and mouseX < 100:
fill(239, 64, 45)
elif leftEdge < mouseX and mouseX < rightEdge and 100 < mouseX < 150:
fill(249, 145, 47)
elif leftEdge < mouseX and mouseX < rightEdge and 150 < mouseX < 200:
fill(244, 226, 58)
elif leftEdge < mouseX and mouseX < rightEdge and 200 < mouseX < 250:
fill(154, 242, 53)
elif leftEdge < mouseX and mouseX < rightEdge and 250 < mouseX < 300:
fill(55, 198, 101)
elif leftEdge < mouseX and mouseX < rightEdge and 300 < mouseX < 350:
fill(77, 228, 242)
elif leftEdge < mouseX and mouseX < rightEdge and 350 < mouseX < 400:
fill(75, 175, 237)
elif leftEdge < mouseX and mouseX < rightEdge and 400 < mouseX < 450:
fill(61, 114, 247)
elif leftEdge < mouseX and mouseX < rightEdge and 450 < mouseX < 500:
fill(62, 49, 237)
elif leftEdge < mouseX and mouseX < rightEdge and 500 < mouseX < 550:
fill(7114, 49, 237)
elif leftEdge < mouseX and mouseX < rightEdge and 550 < mouseX < 600:
fill(183, 49, 237)
else:
fill(250, 250, 250)
rect(x, height/1.5, -magnitude*scalar/2, -magnitude*scalar*5)
x += 2.5