|
38 | 38 | """ |
39 | 39 |
|
40 | 40 |
|
41 | | -def plot_cumulative_events_versus_time_dev(xdata, ydata, obs_data, plot_args, |
42 | | - show=False): |
| 41 | +def plot_cumulative_events_versus_time_dev(xdata, ydata, obs_data, |
| 42 | + plot_args, show=False): |
43 | 43 | """ |
44 | 44 |
|
45 | 45 |
|
@@ -492,8 +492,8 @@ def plot_magnitude_histogram_dev(ses_data, obs, plot_args, show=False): |
492 | 492 | filename = plot_args.get('filename', None) |
493 | 493 |
|
494 | 494 | ax.errorbar(bin_edges_plot, u3etas_median, yerr=[u3etas_emin, u3etas_emax], |
495 | | - xerr=0.8 * dmw / 2, fmt=' ', |
496 | | - label=sim_label, color='blue', alpha=0.7) |
| 495 | + xerr=0.8 * dmw / 2, fmt=' ', label=sim_label, |
| 496 | + color='blue', alpha=0.7) |
497 | 497 | ax.plot(bin_edges_plot, obs_hist, '.k', markersize=10, label=obs_label) |
498 | 498 | ax.legend(loc='upper right') |
499 | 499 | ax.set_xlim(xlim) |
@@ -920,7 +920,7 @@ def plot_spatial_dataset(gridded, region, ax=None, show=False, extent=None, |
920 | 920 | if extent is None and not set_global: |
921 | 921 | extent = [bbox[0], bbox[1], bbox[2], bbox[3]] |
922 | 922 |
|
923 | | - # Retrieve plot arguments |
| 923 | + # Retrieve plot arguments |
924 | 924 | plot_args = plot_args or {} |
925 | 925 | # figure and axes properties |
926 | 926 | figsize = plot_args.get('figsize', None) |
@@ -1651,8 +1651,8 @@ def plot_poisson_consistency_test(eval_results, normalize=False, |
1651 | 1651 | _get_marker_style(observed_statistic, (plow, phigh), |
1652 | 1652 | one_sided_lower)) |
1653 | 1653 | ax.errorbar(mean, index, xerr=percentile_lims, |
1654 | | - fmt='ko' * plot_mean, |
1655 | | - capsize=capsize, linewidth=linewidth, ecolor=color) |
| 1654 | + fmt='ko' * plot_mean, capsize=capsize, |
| 1655 | + linewidth=linewidth, ecolor=color) |
1656 | 1656 | # determine the limits to use |
1657 | 1657 | xlims.append((plow, phigh, observed_statistic)) |
1658 | 1658 | # we want to only extent the distribution where it falls outside of it in the acceptable tail |
@@ -1744,8 +1744,7 @@ def plot_comparison_test(results_t, results_w=None, axes=None, plot_args=None): |
1744 | 1744 | ax.axvspan(index - 0.5, index + 0.5, alpha=0.5, facecolor='red') |
1745 | 1745 | else: |
1746 | 1746 | ax.errorbar(index, result_t.observed_statistic, |
1747 | | - yerr=numpy.array([[ylow, yhigh]]).T, |
1748 | | - color=color, |
| 1747 | + yerr=numpy.array([[ylow, yhigh]]).T, color=color, |
1749 | 1748 | linewidth=linewidth, capsize=capsize) |
1750 | 1749 |
|
1751 | 1750 | if result_w is not None: |
@@ -1887,8 +1886,8 @@ def plot_consistency_test(eval_results, normalize=False, axes=None, |
1887 | 1886 | _get_marker_style(observed_statistic, (plow, phigh), |
1888 | 1887 | one_sided_lower)) |
1889 | 1888 | ax.errorbar(mean, index, xerr=percentile_lims, |
1890 | | - fmt='ko' * plot_mean, |
1891 | | - capsize=capsize, linewidth=linewidth, ecolor=color) |
| 1889 | + fmt='ko' * plot_mean, capsize=capsize, |
| 1890 | + linewidth=linewidth, ecolor=color) |
1892 | 1891 | # determine the limits to use |
1893 | 1892 | xlims.append((plow, phigh, observed_statistic)) |
1894 | 1893 | # we want to only extent the distribution where it falls outside of it in the acceptable tail |
@@ -1989,10 +1988,12 @@ def plot_pvalues_and_intervals(test_results, ax, var=None): |
1989 | 1988 | mean = test_results[i].test_distribution[1] |
1990 | 1989 | upsilon = 1.0 - ((variance - mean) / variance) |
1991 | 1990 | tau = (mean ** 2 / (variance - mean)) |
1992 | | - phigh97 = scipy.stats.nbinom.ppf((1 - percentile / 100.) / 2., |
1993 | | - tau, upsilon) |
| 1991 | + phigh97 = scipy.stats.nbinom.ppf( |
| 1992 | + (1 - percentile / 100.) / 2., tau, upsilon |
| 1993 | + ) |
1994 | 1994 | plow97 = scipy.stats.nbinom.ppf( |
1995 | | - 1 - (1 - percentile / 100.) / 2., tau, upsilon) |
| 1995 | + 1 - (1 - percentile / 100.) / 2., tau, upsilon |
| 1996 | + ) |
1996 | 1997 | low97 = test_results[i].observed_statistic - plow97 |
1997 | 1998 | high97 = phigh97 - test_results[i].observed_statistic |
1998 | 1999 | ax.errorbar(test_results[i].observed_statistic, |
|
0 commit comments