Faces and Earthquakes
Published in
1 min readSep 27, 2017
Baby’s first hair-sway
Visualization
import csvdef setup():
size(800, 500)
with open("quakes.csv") as f:
reader = csv.reader(f)
header = reader.next() # Skip the header row.
#print header
global times
times = []
global magnitudes
magnitudes = []
for row in reader:
time = float(row[0])
times.append(time)
magnitude = float(row[4])
magnitudes.append(magnitude)#print times
#print magnitudesdef draw():
background(0)
#text("time", width/2, 350)
#print times[0]
#print magnitudes[0]
x = 0
for magnitude in magnitudes:
stroke(255)
line(magnitude, times[x]*20, magnitude*50, times[x]*20)
x += 1
the x axis represents magnitude of the earthquake (the longer, the stronger the magnitude)
the y-axis represents the time it was recorded: I edited the original data set to show time as a float (rather than day:hour:minute)