In [1]:
import wget
    import os
    import zipfile
    
    import urllib3
    import certifi
    import sys
    import glob
    
    import numpy as np
    import pandas as pd
    
    import matplotlib.pyplot as plt
    
    %matplotlib inline


    import plotly.offline as py
    import plotly.graph_objs as go
    import plotly.tools as tls
    import seaborn as sns
    
    import plotly
    plotly.offline.init_notebook_mode()



In [2]:
df = pd.read_csv("italy_earthquakes_from_2016-08-24_to_2016-11-30.csv").set_index('Time')
df.index = pd.to_datetime(df.index)
df.head()


Out[2]:
Latitude Longitude Depth/Km Magnitude
Time
2016-08-24 03:36:32.000 42.6983 13.2335 8.1 6.0
2016-08-24 03:37:26.580 42.7123 13.2533 9.0 4.5
2016-08-24 03:40:46.590 42.7647 13.1723 9.7 3.8
2016-08-24 03:41:38.900 42.7803 13.1683 9.7 3.9
2016-08-24 03:42:07.170 42.7798 13.1575 9.7 3.6

In [20]:
import numpy as np
import matplotlib.pyplot as plt

x = df.index
y = df.Magnitude

plt.scatter(x, y)
plt.xlabel("Time")
plt.ylabel("Magnitude")
plt.title("Magnitude for eqarthquakes in Italy")
plt.show()



In [23]:
import numpy as np
import matplotlib.pyplot as plt


x = df.index
y = df.Magnitude

fig, (ax0, ax1) = plt.subplots(nrows=2)

ax0.plot(x, y)
ax0.set_title('Magnitude')

x=df.index
y=df["Depth/Km"]
ax1.plot(x, y)
ax1.set_title('Depth/Km')

# Hide the right and top spines
ax1.spines['right'].set_visible(False)
ax1.spines['top'].set_visible(False)
# Only show ticks on the left and bottom spines
ax1.yaxis.set_ticks_position('left')
ax1.xaxis.set_ticks_position('bottom')

# Tweak spacing between subplots to prevent labels from overlapping
plt.subplots_adjust(hspace=0.5)
plt.style.use('ggplot')

plt.show()



In [ ]: