# File: plotQuakes.py # Purpose: Plot a the locations of earthquakes on a map. # Author: Tanya Amert, based on code by Jessen Havill from graphics import * import time quakes = [(-78.6607, 19.3791), (144.8328, 19.19), (145.9089, 43.5271), (26.6575, 45.7408), (39.3382, 38.4961), (90.8291, 26.3405), (-86.5317, 10.9946), (-68.6365, -20.8024), (-178.5635, -21.1536), (-109.0178, -8.8855), (121.5392, 23.8442), (-73.0089, 6.8183), (126.4892, 1.5424), (-26.1362, -57.9816), (77.68, 40.4246), (27.891, 35.1747), (158.8461, 58.8012), (-179.9388, 51.0946), (71.2396, 36.582), (-70.8768, -24.7854), (27.8918, 35.2183), (27.894, 35.1301), (139.0808, -2.9405), (142.4753, 30.0509), (155.6615, 49.4132), (179.8396, -15.7057), (-79.3671, 3.4132), (-80.7573, 19.0246), (91.7364, 24.7732), (-179.9238, 51.0327), (-178.4964, -30.4704), (126.6651, 5.642), (20.6196, 39.2259), (165.4755, -11.9711), (75.2078, 35.6993), (-66.9401, 17.9245), (113.0778, -6.0817), (-177.673, -20.3533), (101.0846, -2.9038), (85.8682, 34.5922), (140.2131, 37.8626), (126.1732, 5.307), (-25.6007, -59.8231), (-66.9746, -24.1459), (-80.6354, -5.8303), (55.7703, 27.1028), (77.2433, 39.768), (176.5332, -37.645), (161.4052, -10.328), (-82.5301, 6.1019), (141.304, 37.2946), (91.8787, 0.5055), (44.9028, 37.1334), (145.6494, -3.4042), (144.029, 36.4534), (27.952, 35.2972), (130.4661, -6.2615), (124.3402, -11.6731), (-177.8604, 49.9772), (122.1366, 24.2241), (-79.123, 19.321), (-176.1798, -24.1641), (-80.9582, 18.936), (52.1306, 29.5876), (93.2938, 13.1329), (159.248, 52.6189), (-173.0303, -19.5438), (121.3598, 80.7982), (129.1558, -7.0226), (158.7832, -54.5793), (158.0414, -9.0223), (38.7768, 38.2019), (21.4918, 39.2464), (-38.1971, 33.8692), (55.7733, 27.2948), (-74.6195, -7.5697), (-174.7287, -17.6641), (147.4536, -6.0181), (-67.6276, 18.9538), (-79.4258, -2.1553), (-179.5811, -23.3926), (143.722, 26.9494), (-35.2283, 53.42), (99.8976, -1.912), (-179.6616, -35.6033), (-76.6148, -12.2747), (-87.055, 12.6953), (121.6003, 23.8176), (-179.3096, 50.9565), (-14.583, 37.0414), (-66.9576, -24.4393), (73.6458, 7.3359), (125.2034, -0.1911), (158.5963, 54.6787), (146.1061, 43.3158), (165.7846, -10.8944), (-25.3619, -57.2559), (155.7006, 49.8977), (-125.2115, 48.5349), (144.4258, 12.463)] def main(): # Make the window win = GraphWin("Earthquakes", 1024, 512) # set up the window size win.setCoords(-180, -90, 180, 90) # set the min/max coordinates # Draw the map mapImage = Image(Point(0, 0), "oceanbottom.gif") mapImage.draw(win) # Plot the earthquakes for xy in quakes: center = Point(xy[0], xy[1]) quake = Circle(center, 2) quake.setFill("yellow") quake.draw(win) # Wait to make it a nice animation time.sleep(0.15) # Wait for the user to click, then exit win.getMouse() win.close() main()