def read_catalog(fctlg): events = read_ctlg(fctlg) events = slice_ctlg(events, lat_rng=lat_rng, lon_rng=lon_rng, dep_rng=dep_rng) lat = np.array(list(events['lat'])) lon = np.array(list(events['lon'])) dep = np.array(list(events['dep'])) + dep_corr mag = (np.array(list(events['mag'])) + mag_corr) * mark_size return lat, lon, dep, mag
lat_rng = [35.4, 36.1] dep_rng = [0, 20] mag_rng = [-1, 8] # fig params fig_size = (8,6) fsize_label = 14 fsize_title = 18 mark_size = 10. alpha = 0.6 mark_non_cum = '^' mark_cum = '.' # read catalog mags = [] for fctlg in fctlgs: events = read_ctlg(fctlg) events = slice_ctlg(events, mag_rng=mag_rng, lat_rng=lat_rng, lon_rng=lon_rng, dep_rng=dep_rng) mags.append(np.array(list(events['mag']))) # start plot plt.figure(figsize=fig_size) p_list = [] for i in range(len(fctlgs)): mag_bin, num, cum_num = calc_fmd(mags[i]) p_i = plt.semilogy(mag_bin, num, mark_non_cum, markersize=mark_size, color=colors[i], alpha=alpha) p_i+= plt.semilogy(mag_bin, cum_num, mark_cum, markersize=mark_size, color=colors[i], alpha=alpha) p_list.append(p_i[0]) plt.legend(p_list, names, fontsize=fsize_label) plt.xlabel('Magnitude', fontsize=fsize_label) plt.ylabel('Number', fontsize=fsize_label) ax = plt.gca()