Earthquake Magnitude

Whigham Rachel Covington
Data Mining the City
1 min readSep 27, 2017
'''import csvdef setup():
size(600, 600)
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(255)
scalar=10
x = 0
for magnitude in magnitudes:
leftEdge = x - (magnitude * scalar)/2
rightEdge = x + (magnitude * scalar)/2
if leftEdge < mouseX and mouseX < rightEdge:
fill(249, 72, 37)
else:
fill(249, 214, 241)
rect(x, height/2, magnitude*scalar, magnitude*scalar)
x +=2.5

--

--