<jupyter_start><jupyter_text>Read Downsampled BOTPT Data<jupyter_code>with open('/home/jovyan/data/botpt/2019bottom_pressure15s_F.pkl', 'rb') as E:
    botpt_data = pk.load(E)
df_botptF = pd.DataFrame(botpt_data)
df_botptF['bottom_pressure'] = df_botptF['bottom_pressure'].astype(float)
df_botptF['depth']=df_botptF['bottom_pressure'].astype(float) * 0.670
#MJ03F_cal_depths = [MJ03F_pressure * 0.0670 for MJ03F_pressure in MJ03F_pressure]
#list comprehention
epoch= [i.timestamp() for i in df_botptF.index.to_pydatetime()]
df_botptF['epoch'] = epoch
df_botptF= df_botptF.sort_index()
df_botptF.tail()
with open('/home/jovyan/data/botpt/2019bottom_pressure15s_E.pkl', 'rb') as E:
    botpt_data = pk.load(E)
df_botptE = pd.DataFrame(botpt_data)
df_botptE['bottom_pressure'] = df_botptE['bottom_pressure'].astype(float)
df_botptE['depth']=df_botptE['bottom_pressure'].astype(float) * 0.670
#MJ03F_cal_depths = [MJ03F_pressure * 0.0670 for MJ03F_pressure in MJ03F_pressure]
#list comprehention
epoch= [i.timestamp() for i in df_botptE.index.to_pydatetime()]
df_botptE['epoch'] = epoch
df_botptE= df_botptE.sort_index()
df_botptE.tail()<jupyter_output><empty_output><jupyter_text>Cleaning up the DataFrame<jupyter_code>del df_botptE['epoch']
del df_botptE['bottom_pressure']
del df_botptF['epoch']
del df_botptF['bottom_pressure']
df_botptF.tail()
df_botptE.tail()<jupyter_output><empty_output><jupyter_text>Merge BOTPT E and BOTPT F<jupyter_code>test = pd.merge(df_botptF, df_botptE,how='outer', indicator=True, left_index=True, right_index=True, suffixes=('_F', '_E'))
df_botptMerge = test[test['_merge'] == 'both']
del df_botptMerge['_merge']
df_botptMerge = df_botptMerge.loc['2017-1-1 00:00:00':'2019-6-27 00:00:00']
df_botptMerge.tail()<jupyter_output><empty_output><jupyter_text>Calculate Depth difference<jupyter_code>depthDiff = df_botptMerge['depth_E'].values - df_botptMerge['depth_F'].values
df_botptMerge['diff'] = depthDiff<jupyter_output><empty_output><jupyter_text>Create time and height vectors for plotting<jupyter_code># time = list(df_botptMerge.index.values)
#height = x.tolist()
height = df_botptMerge['diff'].tolist()
time_int = []
time = list(pd.to_datetime(df_botptMerge.index.values))
for i in time:
    i = np.datetime64(i).astype(datetime.datetime)
    time_int.append(dates.date2num(i))
plt.close()
fig, ax = plt.subplots()
fig.set_size_inches(28, 6)
hb1 = ax.hexbin(time_int, height, vmin=0, vmax=30, gridsize=(1500,100), mincnt=1, cmap='Greens', linewidths=0)
fig.colorbar(hb1, pad = 0.01)
ax.yaxis.grid(True)
ax.xaxis.grid(True)
ax.set_xlim(datetime.datetime(2017, 1, 1, 0, 0),datetime.datetime(2019, 6, 11, 0, 0))
years = dates.YearLocator()
months = dates.MonthLocator()
yearsFmt = dates.DateFormatter('\n\n\n%Y')
monthsFmt = dates.DateFormatter('%b')
ax.xaxis.set_major_locator(months)
ax.xaxis.set_major_formatter(monthsFmt)
ax.xaxis.set_minor_locator(years)
ax.xaxis.set_minor_formatter(yearsFmt)
plt.tight_layout()
plt.setp(ax.xaxis.get_majorticklabels(), rotation=90)
#plt.gca().invert_yaxis()
plt.show()
df_botptMerge['date']=pd.DatetimeIndex(df_botptMerge.index).date
#df_botptMerge.head()<jupyter_output><empty_output><jupyter_text>Use Groupby to create one day mean measurements<jupyter_code>df_botptMean=df_botptMerge.groupby('date').mean()
df_botptMean.tail()<jupyter_output><empty_output><jupyter_text>Create time and height vectors for plotting<jupyter_code># time = list(df_botptMerge.index.values)
#height = x.tolist()
height = df_botptMean['diff'].tolist()
time_int = []
time = list(pd.to_datetime(df_botptMean.index.values))
for i in time:
    i = np.datetime64(i).astype(datetime.datetime)
    time_int.append(dates.date2num(i))
# Plot one day 
plt.close()
fig, ax = plt.subplots()
fig.set_size_inches(28, 6)
hb1 = ax.plot(time_int, height)
ax.yaxis.grid(True)
ax.xaxis.grid(True)
ax.set_xlim(datetime.datetime(2017, 1, 1, 0, 0),datetime.datetime(2019, 6, 11, 0, 0))
years = dates.YearLocator()
months = dates.MonthLocator()
yearsFmt = dates.DateFormatter('\n\n\n%Y')
monthsFmt = dates.DateFormatter('%b')
ax.xaxis.set_major_locator(months)
ax.xaxis.set_major_formatter(monthsFmt)
ax.xaxis.set_minor_locator(years)
ax.xaxis.set_minor_formatter(yearsFmt)
plt.tight_layout()
plt.setp(ax.xaxis.get_majorticklabels(), rotation=90)
#plt.gca().invert_yaxis()
plt.show()
# Remove spikes
weird_data = np.array(height)
time_array = np.array(time)

cleaner_data = []
cleaner_time = []

# i = 0
# while i < len(weird_data):
#     if (weird_data[i] - weird_data[i-1] > 2

length = len(weird_data)

i = 0
while i < length:
    j = i+2
    while j < length:
        if np.abs(weird_data[i] - weird_data[j]) < .05:
            cleaner_data.append(weird_data[j])
            cleaner_time.append(time_array[j])
            break
        else:
            j += 1
    i = j<jupyter_output><empty_output><jupyter_text>Comparison between plots with and without spikes.<jupyter_code>plt.close()
fig3, (ax1,ax2) = plt.subplots(2,1)
fig3.set_size_inches(28, 14)
hb1 = ax1.plot(time_int, height, linewidth=5)
ax1.yaxis.grid(True)
ax1.xaxis.grid(True)
ax1.set_xlim(datetime.datetime(2017, 1, 1, 0, 0),datetime.datetime(2019, 6, 11, 0, 0))
years = dates.YearLocator()
months = dates.MonthLocator()
yearsFmt = dates.DateFormatter('\n\n\n%Y')
monthsFmt = dates.DateFormatter('%b')
ax1.xaxis.set_major_locator(months)
ax1.xaxis.set_major_formatter(monthsFmt)
ax1.xaxis.set_minor_locator(years)
ax1.xaxis.set_minor_formatter(yearsFmt)

hb1 = ax2.plot(cleaner_time, cleaner_data, linewidth=5)
ax2.yaxis.grid(True)
ax2.xaxis.grid(True)
ax2.set_xlim(datetime.datetime(2017, 1, 1, 0, 0),datetime.datetime(2019, 6, 11, 0, 0))
years = dates.YearLocator()
months = dates.MonthLocator()
yearsFmt = dates.DateFormatter('\n\n\n%Y')
monthsFmt = dates.DateFormatter('%b')
ax2.xaxis.set_major_locator(months)
ax2.xaxis.set_major_formatter(monthsFmt)
ax2.xaxis.set_minor_locator(years)
ax2.xaxis.set_minor_formatter(yearsFmt)

plt.tight_layout()
plt.setp(ax1.xaxis.get_majorticklabels(), rotation=90)
plt.suptitle('Removing Outliers', fontsize=32, color= 'red', fontweight = 'bold')
plt.subplots_adjust(top=0.90)
#plt.gca().invert_yaxis()
plt.savefig('/home/jovyan/botpt/figures/botptspikes.png')
plt.show()<jupyter_output><empty_output><jupyter_text>Import Seismic Data<jupyter_code>seismic_file = '/home/jovyan/data/hypo71.dat.txt'
df_seismic_data = pd.read_csv(seismic_file, delim_whitespace=True, dtype=object)
df_seismic_data['datetime'] = df_seismic_data['yyyymmdd'] + 'T' + \
            df_seismic_data['HHMM'].str.slice(start=0, stop=2) + ':' + \
            df_seismic_data['HHMM'].str.slice(start=2) 
df_seismic_data.index = pd.to_datetime(df_seismic_data['datetime'].values)
df_seismic_data['datetime'] = pd.to_datetime(df_seismic_data['datetime'].values)
df_seismic_data = df_seismic_data.loc['2017-01-1 00:00:00':'2019-06-17 00:00:00']
df_seismic_data.head()
# del df_seismic_data['yyyymmdd']
# del df_seismic_data['HHMM']
del df_seismic_data['Lon(D']
# del df_seismic_data['SSS.SS']
# del df_seismic_data['Depth']
del df_seismic_data['M)']
del df_seismic_data['M).1']
del df_seismic_data['NWR']
del df_seismic_data['GAP']
del df_seismic_data['DMIN']
del df_seismic_data['ERH']
del df_seismic_data['ERZ']
del df_seismic_data['ID']
del df_seismic_data['Lat(D']
del df_seismic_data['PMom']
del df_seismic_data['SMom']
df_seismic_data['Depth'] = df_seismic_data['Depth'].astype('float64').values
df_seismic_data['MW'] = df_seismic_data['MW'].astype('float64').values
df_seismic_data['RMS'] = df_seismic_data['RMS'].astype('float64').values
df_seismic_data.datetime.astype(np.int64).values/1e64
df_seismic_data['date'] =pd.DatetimeIndex(df_seismic_data.datetime).date
df_seismic_data.tail()
df_seismic_data.plot(x='datetime', y= 'Depth')
plt.savefig('/home/jovyan/botpt/figures/eqdepth.png')
df_eqMean=df_seismic_data.groupby('date').mean()
df_eqCount= df_seismic_data.groupby('date').count()
#del df_eqMean['datetime']
#df_eqMean.columns.name = df_eqMean.index.name
#df_eqMean.index.name = None
df_eqMean.tail()
# df_eqCount['count'] = df_eqCount.datetime.astype('float64').values
# df_eqCount.head()
# df_eqMean['count'] = df_eqCount['count'].values
# df_eqMean.head()<jupyter_output><empty_output><jupyter_text>Resample. Add days to our earthquake data where there were zero earthquakes.<jupyter_code># idx = pd.date_range('2017-01-1 00:00:00', '2019-06-16 00:00:00')

# df_eqMean = df_eqMean

# df_eqMean.index = pd.DatetimeIndex(df_eqMean.index)

# df_eqMean = df_eqMean.reindex(idx, fill_value=0)
# df_eqMean.tail()
# import hvplot.pandas
# a= df_eqMean.hvplot.scatter(y= 'count')
# b= df_eqMean.hvplot.scatter(y= 'Depth')
# a+b
# df_eqMean.hvplot.scatter(y= ['count', 'Depth','MW','RMS']
#                         , subplots=True, shared_axes=False).cols(1)
# # hv.save('botptvseqcount.png')
# hvplot.save('/home/jovyan/botpt/figures/botptvseqcount.png')
# plt.savefig('/home/jovyan/botpt/figures/botptvseqcount.png')<jupyter_output><empty_output><jupyter_text>Create time and count vectors earthquake frequency vectors for plotting<jupyter_code># count = df_eqMean['count'].tolist()
# time_int = []
# time = list(pd.to_datetime(df_eqMean.index.values))
# for i in time:
#     i = np.datetime64(i).astype(datetime.datetime)
#     time_int.append(dates.date2num(i))
# def movingaverage(interval, window_size):
#     window= np.ones(int(window_size))/float(window_size)
#     return np.convolve(interval, window, 'same')
# smooth data using rolling window that chops off 95th percentile 
# count_av = list(movingaverage(df_eqMean['count'],21))<jupyter_output><empty_output><jupyter_text>Plotting BOTPT caldera inflation vs earthquake count<jupyter_code># plt.close()
# fig4, (ax1,ax2) = plt.subplots(2,1)
# fig4.set_size_inches(30, 14)
# hb1 = ax1.plot(cleaner_time, cleaner_data, linewidth=5)
# ax1.yaxis.grid(True)
# ax1.xaxis.grid(True)
# ax1.set_xlim(datetime.datetime(2017, 1, 1, 0, 0),datetime.datetime(2019, 6, 17, 0, 0))
# #years = dates.YearLocator()
# months = dates.MonthLocator()
# #yearsFmt = dates.DateFormatter('\n\n\n%Y')
# monthsFmt = dates.DateFormatter('%b')
# ax1.xaxis.set_major_locator(months)
# ax1.xaxis.set_major_formatter(monthsFmt)
# #ax1.xaxis.set_minor_locator(years)
# #ax1.xaxis.set_minor_formatter(yearsFmt)
# ax1.set_title('Caldera Inflation', fontsize=36, fontweight = 'bold')
# ax1.set_ylabel('Depth-Diff (m)', fontsize=36, fontweight = 'bold', rotation=90)


# hb1 = ax2.plot(time, count)
# hb2 = ax2.plot(time, count_av, linewidth=5)
# ax2.yaxis.grid(True)
# ax2.xaxis.grid(True)
# ax2.set_xlim(datetime.datetime(2017, 1, 1, 0, 0),datetime.datetime(2019, 6, 17, 0, 0))
# years = dates.YearLocator()
# months = dates.MonthLocator()
# yearsFmt = dates.DateFormatter('\n\n\n%Y')
# monthsFmt = dates.DateFormatter('%b')
# ax2.xaxis.set_major_locator(months)
# ax2.xaxis.set_major_formatter(monthsFmt)
# ax2.xaxis.set_minor_locator(years)
# ax2.xaxis.set_minor_formatter(yearsFmt)
# ax2.set_title('Daily Seismicity', fontsize=36, fontweight = 'bold')
# ax2.set_ylabel('EQ/Day', fontsize=36, fontweight = 'bold', rotation=90)

# #plt.tight_layout()
# plt.setp(ax1.set_xticklabels([]))
# #plt.setp(ax1.xaxis.get_majorticklabels(), rotation=0, fontsize=24)
# #plt.setp(ax1.xaxis.get_minorticklabels(), rotation=0, fontsize=24)
# plt.setp(ax1.yaxis.get_majorticklabels(), rotation=0, fontsize=24, fontweight = 'bold')

# plt.setp(ax2.xaxis.get_majorticklabels(), rotation=0, fontsize=24, fontweight = 'bold')
# plt.setp(ax2.xaxis.get_minorticklabels(), rotation=0, fontsize=36, fontweight = 'bold')
# plt.setp(ax2.yaxis.get_majorticklabels(), rotation=0, fontsize=24, fontweight = 'bold')

# plt.suptitle('Comparison Between Inflation and Seismicity',
#             fontsize=32, color= 'blue', fontweight = 'bold')
# plt.subplots_adjust(top=0.90, hspace=0.25)
# plt.savefig('/home/jovyan/botpt/figures/botptvseqcount.png')
df_eqMean['Depth'].tail(10)<jupyter_output><empty_output><jupyter_text>Create time and MW vectors for plotting<jupyter_code>depth = df_eqMean['Depth'].tolist()
time_int = []
time = list(pd.to_datetime(df_eqMean.index.values))
for i in time:
    i = np.datetime64(i).astype(datetime.datetime)
    time_int.append(dates.date2num(i))
def movingaverage(interval, window_size):
    window= np.ones(int(window_size))/float(window_size)
    return np.convolve(interval, window, 'same')
# smooth data using rolling window that chops off 95th percentile 
depth_av = list(movingaverage(df_eqMean['Depth'],21))
plt.close()
fig4, (ax1,ax2) = plt.subplots(2,1)
fig4.set_size_inches(30, 14)
hb1 = ax1.plot(cleaner_time, cleaner_data, linewidth=5)
ax1.yaxis.grid(True)
ax1.xaxis.grid(True)
ax1.set_xlim(datetime.datetime(2017, 1, 1, 0, 0),datetime.datetime(2019, 6, 17, 0, 0))
#years = dates.YearLocator()
months = dates.MonthLocator()
#yearsFmt = dates.DateFormatter('\n\n\n%Y')
monthsFmt = dates.DateFormatter('%b')
ax1.xaxis.set_major_locator(months)
ax1.xaxis.set_major_formatter(monthsFmt)
#ax1.xaxis.set_minor_locator(years)
#ax1.xaxis.set_minor_formatter(yearsFmt)
ax1.set_title('Caldera Inflation', fontsize=36, fontweight = 'bold')
ax1.set_ylabel('Depth-Diff (m)', fontsize=36, fontweight = 'bold', rotation=90)


hb1 = ax2.plot(time, depth)
hb2 = ax2.plot(time, depth_av, linewidth=5)
ax2.yaxis.grid(True)
ax2.xaxis.grid(True)
ax2.set_xlim(datetime.datetime(2017, 1, 1, 0, 0),datetime.datetime(2019, 6, 17, 0, 0))
years = dates.YearLocator()
months = dates.MonthLocator()
yearsFmt = dates.DateFormatter('\n\n\n%Y')
monthsFmt = dates.DateFormatter('%b')
ax2.xaxis.set_major_locator(months)
ax2.xaxis.set_major_formatter(monthsFmt)
ax2.xaxis.set_minor_locator(years)
ax2.xaxis.set_minor_formatter(yearsFmt)
ax2.set_title('Earthquake Depth', fontsize=36, fontweight = 'bold')
ax2.set_ylabel('depth (km)', fontsize=36, fontweight = 'bold', rotation=90)

#plt.tight_layout()
plt.setp(ax1.set_xticklabels([]))
#plt.setp(ax1.xaxis.get_majorticklabels(), rotation=0, fontsize=24)
#plt.setp(ax1.xaxis.get_minorticklabels(), rotation=0, fontsize=24)
plt.setp(ax1.yaxis.get_majorticklabels(), rotation=0, fontsize=24, fontweight = 'bold')

plt.setp(ax2.xaxis.get_majorticklabels(), rotation=0, fontsize=24, fontweight = 'bold')
plt.setp(ax2.xaxis.get_minorticklabels(), rotation=0, fontsize=36, fontweight = 'bold')
plt.setp(ax2.yaxis.get_majorticklabels(), rotation=0, fontsize=24, fontweight = 'bold')

plt.suptitle('Comparison Between Inflation and Earthquake Depth',
            fontsize=32, color= 'blue', fontweight = 'bold')
plt.subplots_adjust(top=0.90, hspace=0.25)
plt.savefig('/home/jovyan/botpt/figures/botptvseqdepth.png')
depth = df_eqMean['Depth'].tolist()
time_int = []
time = list(pd.to_datetime(df_eqMean.index.values))
for i in time:
    i = np.datetime64(i).astype(datetime.datetime)
    time_int.append(dates.date2num(i))
def movingaverage(interval, window_size):
    window= np.ones(int(window_size))/float(window_size)
    return np.convolve(interval, window, 'same')
# smooth data using rolling window that chops off 95th percentile 
depth_av = list(movingaverage(df_eqMean['Depth'],21))
plt.close()
fig4, (ax1,ax4) = plt.subplots(2,1)
fig4.set_size_inches(30, 14)
hb1 = ax1.plot(cleaner_time, cleaner_data, linewidth=5)
ax1.yaxis.grid(True)
ax1.xaxis.grid(True)
ax1.set_xlim(datetime.datetime(2017, 1, 1, 0, 0),datetime.datetime(2019, 6, 17, 0, 0))
#years = dates.YearLocator()
months = dates.MonthLocator()
#yearsFmt = dates.DateFormatter('\n\n\n%Y')
monthsFmt = dates.DateFormatter('%b')
ax1.xaxis.set_major_locator(months)
ax1.xaxis.set_major_formatter(monthsFmt)
#ax1.xaxis.set_minor_locator(years)
#ax1.xaxis.set_minor_formatter(yearsFmt)
ax1.set_title('Caldera Inflation', fontsize=36, fontweight = 'bold')
ax1.set_ylabel('Depth-Diff (m)', fontsize=36, fontweight = 'bold', rotation=90)


hb1 = ax4.plot(time, depth)
hb2 = ax4.plot(time, depth_av, linewidth=5)
ax4.yaxis.grid(True)
ax4.xaxis.grid(True)
ax4.set_xlim(datetime.datetime(2017, 1, 1, 0, 0),datetime.datetime(2019, 6, 17, 0, 0))
years = dates.YearLocator()
months = dates.MonthLocator()
yearsFmt = dates.DateFormatter('\n\n\n%Y')
monthsFmt = dates.DateFormatter('%b')
ax4.xaxis.set_major_locator(months)
ax4.xaxis.set_major_formatter(monthsFmt)
ax4.xaxis.set_minor_locator(years)
ax4.xaxis.set_minor_formatter(yearsFmt)
ax4.set_title('Earthquake Depth', fontsize=36, fontweight = 'bold')
ax4.set_ylabel('Depth', fontsize=36, fontweight = 'bold', rotation=90)

#plt.tight_layout()
plt.setp(ax1.set_xticklabels([]))
#plt.setp(ax1.xaxis.get_majorticklabels(), rotation=0, fontsize=24)
#plt.setp(ax1.xaxis.get_minorticklabels(), rotation=0, fontsize=24)
plt.setp(ax1.yaxis.get_majorticklabels(), rotation=0, fontsize=24, fontweight = 'bold')

plt.setp(ax4.xaxis.get_majorticklabels(), rotation=0, fontsize=24, fontweight = 'bold')
plt.setp(ax4.xaxis.get_minorticklabels(), rotation=0, fontsize=36, fontweight = 'bold')
plt.setp(ax4.yaxis.get_majorticklabels(), rotation=0, fontsize=24, fontweight = 'bold')

plt.suptitle('Comparison Between Inflation and Earthquake Magnitude',
            fontsize=32, color= 'blue', fontweight = 'bold')
plt.subplots_adjust(top=0.90, hspace=0.25)
plt.savefig('/home/jovyan/botpt/figures/botptvseqdepth.png')
plt.close()
fig4, (ax1,ax2, ax3, ax4) = plt.subplots(4,1)
fig4.set_size_inches(30, 14)
hb1 = ax1.plot(cleaner_time, cleaner_data, linewidth=5)
ax1.yaxis.grid(True)
ax1.xaxis.grid(True)
ax1.set_xlim(datetime.datetime(2017, 1, 1, 0, 0),datetime.datetime(2019, 6, 17, 0, 0))
#years = dates.YearLocator()
months = dates.MonthLocator()
#yearsFmt = dates.DateFormatter('\n\n\n%Y')
monthsFmt = dates.DateFormatter('%b')
ax1.xaxis.set_major_locator(months)
ax1.xaxis.set_major_formatter(monthsFmt)
#ax1.xaxis.set_minor_locator(years)
#ax1.xaxis.set_minor_formatter(yearsFmt)
ax1.set_title('Caldera Inflation', fontsize=36, fontweight = 'bold')
ax1.set_ylabel('Depth-Diff (m)', fontsize=24, fontweight = 'bold', rotation=90)


hb1 = ax2.plot(time, depth)
hb2 = ax2.plot(time, de_av, linewidth=5)
ax2.yaxis.grid(True)
ax2.xaxis.grid(True)
ax2.set_xlim(datetime.datetime(2017, 1, 1, 0, 0),datetime.datetime(2019, 6, 17, 0, 0))
years = dates.YearLocator()
months = dates.MonthLocator()
yearsFmt = dates.DateFormatter('\n\n\n%Y')
monthsFmt = dates.DateFormatter('%b')
ax2.xaxis.set_major_locator(months)
ax2.xaxis.set_major_formatter(monthsFmt)
ax2.xaxis.set_minor_locator(years)
ax2.xaxis.set_minor_formatter(yearsFmt)
ax2.set_title('Earthquake Depth', fontsize=36, fontweight = 'bold')
ax2.set_ylabel('Depth', fontsize=24, fontweight = 'bold', rotation=90)

hb1 = ax3.plot(time, count)
hb2 = ax3.plot(time, count_av, linewidth=5)
ax3.yaxis.grid(True)
ax3.xaxis.grid(True)
ax3.set_xlim(datetime.datetime(2017, 1, 1, 0, 0),datetime.datetime(2019, 6, 17, 0, 0))
years = dates.YearLocator()
months = dates.MonthLocator()
yearsFmt = dates.DateFormatter('\n\n\n%Y')
monthsFmt = dates.DateFormatter('%b')
ax3.xaxis.set_major_locator(months)
ax3.xaxis.set_major_formatter(monthsFmt)
ax3.xaxis.set_minor_locator(years)
ax3.xaxis.set_minor_formatter(yearsFmt)
ax3.set_title('Earthquake Magnitude', fontsize=36, fontweight = 'bold')
ax3.set_ylabel('MW', fontsize=24, fontweight = 'bold', rotation=90)

hb1 = ax4.plot(time, count)
hb2 = ax4.plot(time, count_av, linewidth=5)
ax4.yaxis.grid(True)
ax4.xaxis.grid(True)
ax4.set_xlim(datetime.datetime(2017, 1, 1, 0, 0),datetime.datetime(2019, 6, 17, 0, 0))
years = dates.YearLocator()
months = dates.MonthLocator()
yearsFmt = dates.DateFormatter('\n\n\n%Y')
monthsFmt = dates.DateFormatter('%b')
ax4.xaxis.set_major_locator(months)
ax4.xaxis.set_major_formatter(monthsFmt)
ax4.xaxis.set_minor_locator(years)
ax4.xaxis.set_minor_formatter(yearsFmt)
ax4.set_title('Daily Seismicity', fontsize=36, fontweight = 'bold')
ax4.set_ylabel('EQ/Day', fontsize=24, fontweight = 'bold', rotation=90)

#plt.tight_layout()
plt.setp(ax1.set_xticklabels([]))
#plt.setp(ax1.xaxis.get_majorticklabels(), rotation=0, fontsize=24)
#plt.setp(ax1.xaxis.get_minorticklabels(), rotation=0, fontsize=24)
plt.setp(ax1.yaxis.get_majorticklabels(), rotation=0, fontsize=24, fontweight = 'bold')
plt.setp(ax2.yaxis.get_majorticklabels(), rotation=0, fontsize=24, fontweight = 'bold')
plt.setp(ax3.yaxis.get_majorticklabels(), rotation=0, fontsize=24, fontweight = 'bold')
plt.setp(ax4.yaxis.get_minorticklabels(), rotation=0, fontsize=24, fontweight = 'bold')

# plt.setp(ax4.xaxis.get_majorticklabels(), rotation=0, fontsize=24, fontweight = 'bold')

plt.suptitle('Comparison Between Inflation and Earthquake Magnitude',
            fontsize=32, color= 'blue', fontweight = 'bold')
plt.subplots_adjust(top=0.90, hspace=0.25)
plt.savefig('/home/jovyan/botpt/figures/botptvseq.png')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16156783142429076, 'fraction_numerical': 0.0414189744333285, 'mean_word_length': 7.0828125, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 54, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '13', 'dir': 'jupyter-structured-clean-dedup', 'id': '204244', 'license': 'MIT', 'n_tokens_mistral': 9161, 'n_tokens_neox': 8357, 'n_words': 1205, 'path': 'notebooks/eqdepth.ipynb', 'repo_name': 'daxsoule/BOTPT', 'size': '20691'}