Beispiel #1
0
def test_probplot_beta_dist_best_fit_x(plot_data):
    fig, (ax1, ax2) = plt.subplots(nrows=2)
    dist = stats.beta(3, 3)
    fig = viz.probplot(
        plot_data,
        dist=dist,
        ax=ax1,
        problabel="Beta scale",
        bestfit=True,
        datascale="log",
        probax="x",
    )
    ax1.set_xlim(left=0.5, right=98)

    fig = viz.probplot(
        plot_data,
        ax=ax2,
        problabel="Default (norm)",
        bestfit=True,
        datascale="log",
        probax="x",
        estimate_ci=True,
    )
    ax2.set_xlim(left=0.5, right=98)

    assert isinstance(fig, plt.Figure)
    return fig
Beispiel #2
0
def test_probplot_beta_dist_best_fit_y(plot_data):
    fig, (ax1, ax2) = plt.subplots(ncols=2)
    dist = stats.beta(3, 3)
    fig = viz.probplot(plot_data, dist=dist, ax=ax1, problabel='Beta scale',
                       bestfit=True, datascale='log', probax='y')
    ax1.set_ylim(bottom=0.5, top=98)

    fig = viz.probplot(plot_data, ax=ax2, datalabel='Default (norm)',
                       bestfit=True, datascale='log', probax='y',
                       estimate_ci=True)
    ax2.set_ylim(bottom=0.5, top=98)

    assert isinstance(fig, plt.Figure)
    return fig
Beispiel #3
0
def test_probplot_beta_dist_best_fit_x(plot_data):
    fig, (ax1, ax2) = plt.subplots(nrows=2)
    dist = stats.beta(3, 3)
    fig = viz.probplot(plot_data, dist=dist, ax=ax1, problabel='Beta scale',
                       bestfit=True, datascale='log', probax='x')
    ax1.set_xlim(left=0.5, right=98)

    fig = viz.probplot(plot_data, ax=ax2, problabel='Default (norm)',
                       bestfit=True, datascale='log', probax='x',
                       estimate_ci=True)
    ax2.set_xlim(left=0.5, right=98)

    assert isinstance(fig, plt.Figure)
    return fig
Beispiel #4
0
def test_probplot_qq_dist(plot_data):
    fig, ax = plt.subplots()
    norm = stats.norm(*stats.norm.fit(plot_data))
    fig = viz.probplot(
        plot_data, ax=ax, plottype="qq", dist=norm, datalabel="Test label"
    )
    return fig
Beispiel #5
0
def test_probplot_pp(plot_data):
    fig, ax = plt.subplots()
    scatter_kws = dict(color='b', linestyle='--', markeredgecolor='g', markerfacecolor='none')
    fig = viz.probplot(plot_data, ax=ax, plottype='pp', datascale='linear',
                       datalabel='test x', problabel='test y',
                       scatter_kws=scatter_kws)
    return fig
Beispiel #6
0
def test_probplot_prob_probax_y(plot_data):
    fig, ax = plt.subplots()
    fig = viz.probplot(
        plot_data, ax=ax, datalabel="Test xlabel", datascale="log", probax="y"
    )
    assert isinstance(fig, plt.Figure)
    return fig
Beispiel #7
0
def test_probplot_test_results():
    fig, ax = plt.subplots()
    data = setup_plot_data()
    fig, results = viz.probplot(data, return_results=True)

    nt.assert_true(isinstance(results, dict))
    known_keys = sorted(['q', 'x', 'y', 'xhat', 'yhat', 'res'])
    nt.assert_list_equal(sorted(list(results.keys())), known_keys)
Beispiel #8
0
def test_probplot_test_results(plot_data):
    fig, ax = plt.subplots()
    fig, results = viz.probplot(plot_data, return_best_fit_results=True)

    assert isinstance(results, dict)
    known_keys = sorted(["q", "x", "y", "xhat", "yhat", "res"])
    assert sorted(list(results.keys())) == known_keys
    return fig
Beispiel #9
0
def test_probplot_color_and_label(plot_data):
    fig, ax = plt.subplots()
    fig = viz.probplot(plot_data,
                       ax=ax,
                       color='pink',
                       label='A Top-Level Label')
    ax.legend(loc='lower right')
    return fig
Beispiel #10
0
def test_probplot_test_results(plot_data):
    fig, ax = plt.subplots()
    fig, results = viz.probplot(plot_data, return_best_fit_results=True)

    assert isinstance(results, dict)
    known_keys = sorted(['q', 'x', 'y', 'xhat', 'yhat', 'res'])
    assert sorted(list(results.keys())) == known_keys
    return fig
Beispiel #11
0
def test_probplot_pp_bestfit_probax_y(plot_data):
    fig, ax = plt.subplots()
    scatter_kws = {'marker': 's', 'color': 'red'}
    line_kws = {'linestyle': '--', 'linewidth': 3}
    fig = viz.probplot(plot_data, ax=ax, plottype='pp', datascale='linear', probax='y',
                       datalabel='test x', bestfit=True, problabel='test y',
                       scatter_kws=scatter_kws, line_kws=line_kws, estimate_ci=True)
    return fig
Beispiel #12
0
def test_probplot_prob(plot_data):
    fig, ax = plt.subplots()
    fig = viz.probplot(plot_data,
                       ax=ax,
                       problabel='Test xlabel',
                       datascale='log')
    assert isinstance(fig, plt.Figure)
    return fig
Beispiel #13
0
def test_probplot_test_results(plot_data):
    fig, ax = plt.subplots()
    fig, results = viz.probplot(plot_data, return_best_fit_results=True)

    assert isinstance(results, dict)
    known_keys = sorted(['q', 'x', 'y', 'xhat', 'yhat', 'res'])
    assert sorted(list(results.keys())) == known_keys
    return fig
Beispiel #14
0
def test_probplot_pp_bestfit_probax_y():
    fig, ax = plt.subplots()
    data = setup_plot_data()
    scatter_kws = {'marker': 's', 'color': 'red'}
    line_kws = {'linestyle': '--', 'linewidth': 3}
    fig = viz.probplot(data, ax=ax, axtype='pp', otherscale='linear', probax='y',
                       xlabel='test x', bestfit=True, ylabel='test y',
                       scatter_kws=scatter_kws, line_kws=line_kws)
Beispiel #15
0
def test_probplot_qq(plot_data):
    fig, ax = plt.subplots()
    fig = viz.probplot(plot_data,
                       ax=ax,
                       plottype='qq',
                       datalabel='Test label',
                       datascale='log',
                       scatter_kws=dict(color='r'))
    return fig
Beispiel #16
0
def test_probplot_qq_bestfit(plot_data):
    fig, ax = plt.subplots()
    fig = viz.probplot(plot_data,
                       ax=ax,
                       plottype='qq',
                       bestfit=True,
                       problabel='Test label',
                       datascale='log',
                       estimate_ci=True)
    return fig
Beispiel #17
0
def test_probplot_prob_bestfit(plot_data):
    fig, ax = plt.subplots()
    fig = viz.probplot(plot_data,
                       ax=ax,
                       datalabel='Test xlabel',
                       bestfit=True,
                       datascale='log',
                       estimate_ci=True)
    assert isinstance(fig, plt.Figure)
    return fig
Beispiel #18
0
def test_probplot_qq(plot_data):
    fig, ax = plt.subplots()
    fig = viz.probplot(
        plot_data,
        ax=ax,
        plottype="qq",
        datalabel="Test label",
        datascale="log",
        scatter_kws=dict(color="r"),
    )
    return fig
Beispiel #19
0
def test_probplot_qq_bestfit(plot_data):
    fig, ax = plt.subplots()
    fig = viz.probplot(
        plot_data,
        ax=ax,
        plottype="qq",
        bestfit=True,
        problabel="Test label",
        datascale="log",
        estimate_ci=True,
    )
    return fig
Beispiel #20
0
def test_probplot_prob_bestfit_probax_y(plot_data):
    fig, ax = plt.subplots()
    fig = viz.probplot(
        plot_data,
        ax=ax,
        datalabel="Test xlabel",
        bestfit=True,
        datascale="log",
        probax="y",
        estimate_ci=True,
    )
    assert isinstance(fig, plt.Figure)
    return fig
Beispiel #21
0
def test_probplot_prob_bestfit_exceedance(plot_data):
    fig, ax = plt.subplots()
    fig = viz.probplot(
        plot_data,
        ax=ax,
        datalabel="Test xlabel",
        bestfit=True,
        datascale="log",
        estimate_ci=True,
        pp_kws={"exceedance": True},
    )
    assert isinstance(fig, plt.Figure)
    return fig
Beispiel #22
0
def test_probplot_pp(plot_data):
    fig, ax = plt.subplots()
    scatter_kws = dict(color='b',
                       linestyle='--',
                       markeredgecolor='g',
                       markerfacecolor='none')
    fig = viz.probplot(plot_data,
                       ax=ax,
                       plottype='pp',
                       datascale='linear',
                       datalabel='test x',
                       problabel='test y',
                       scatter_kws=scatter_kws)
    return fig
Beispiel #23
0
def test_probplot_beta_dist_best_fit_y(plot_data):
    fig, (ax1, ax2) = plt.subplots(ncols=2)
    dist = stats.beta(3, 3)
    fig = viz.probplot(plot_data,
                       dist=dist,
                       ax=ax1,
                       problabel='Beta scale',
                       bestfit=True,
                       datascale='log',
                       probax='y')
    ax1.set_ylim(bottom=0.5, top=98)

    fig = viz.probplot(plot_data,
                       ax=ax2,
                       datalabel='Default (norm)',
                       bestfit=True,
                       datascale='log',
                       probax='y',
                       estimate_ci=True)
    ax2.set_ylim(bottom=0.5, top=98)

    assert isinstance(fig, plt.Figure)
    return fig
Beispiel #24
0
def test_probplot_pp_bestfit(plot_data):
    fig, ax = plt.subplots()
    scatter_kws = {'marker': 's', 'color': 'red'}
    line_kws = {'linestyle': '--', 'linewidth': 3}
    fig = viz.probplot(plot_data,
                       ax=ax,
                       plottype='pp',
                       datascale='linear',
                       datalabel='test x',
                       bestfit=True,
                       problabel='test y',
                       scatter_kws=scatter_kws,
                       line_kws=line_kws,
                       estimate_ci=True)
    return fig
Beispiel #25
0
def test_probplot_pp(plot_data):
    fig, ax = plt.subplots()
    scatter_kws = dict(
        color="b", linestyle="--", markeredgecolor="g", markerfacecolor="none"
    )
    fig = viz.probplot(
        plot_data,
        ax=ax,
        plottype="pp",
        datascale="linear",
        datalabel="test x",
        problabel="test y",
        scatter_kws=scatter_kws,
    )
    return fig
Beispiel #26
0
def test_probplot_pp_bestfit(plot_data):
    fig, ax = plt.subplots()
    scatter_kws = {"marker": "s", "color": "red"}
    line_kws = {"linestyle": "--", "linewidth": 3}
    fig = viz.probplot(
        plot_data,
        ax=ax,
        plottype="pp",
        datascale="linear",
        datalabel="test x",
        bestfit=True,
        problabel="test y",
        scatter_kws=scatter_kws,
        line_kws=line_kws,
        estimate_ci=True,
    )
    return fig
Beispiel #27
0
def test_probplot_qq_bestfit_probax_y(plot_data):
    fig, ax = plt.subplots()
    fig = viz.probplot(plot_data, ax=ax, plottype='qq', bestfit=True, problabel='Test label',
                       datascale='log', probax='y', estimate_ci=True)
    return fig
Beispiel #28
0
def test_probplot_prob_bestfit_probax_y(plot_data):
    fig, ax = plt.subplots()
    fig = viz.probplot(plot_data, ax=ax, datalabel='Test xlabel', bestfit=True,
                       datascale='log', probax='y', estimate_ci=True)
    assert isinstance(fig, plt.Figure)
    return fig
Beispiel #29
0
def test_probplot_qq_probax_y(plot_data):
    fig, ax = plt.subplots()
    fig = viz.probplot(plot_data, ax=ax, plottype='qq', problabel='Test label', probax='y',
                       datascale='log', scatter_kws=dict(color='r'))
    return fig
Beispiel #30
0
def test_probplot_prob_probax_y(plot_data):
    fig, ax = plt.subplots()
    fig = viz.probplot(plot_data, ax=ax, datalabel='Test xlabel', datascale='log', probax='y')
    assert isinstance(fig, plt.Figure)
    return fig
Beispiel #31
0
def test_probplot_color_and_label(plot_data):
    fig, ax = plt.subplots()
    fig = viz.probplot(plot_data, ax=ax, color="pink", label="A Top-Level Label")
    ax.legend(loc="lower right")
    return fig
Beispiel #32
0
def test_probplot_qq_bestfit_probax_y():
    fig, ax = plt.subplots()
    data = setup_plot_data()
    fig = viz.probplot(data, ax=ax, axtype='qq', bestfit=True, ylabel='Test label', otherscale='log', probax='y')
Beispiel #33
0
def test_probplot_prob_bestfit_probax_y():
    fig, ax = plt.subplots()
    data = setup_plot_data()
    fig = viz.probplot(data, ax=ax, xlabel='Test xlabel', bestfit=True, otherscale='log', probax='y')
    nt.assert_true(isinstance(fig, plt.Figure))
Beispiel #34
0
def test_probplot_qq_dist(plot_data):
    fig, ax = plt.subplots()
    norm = stats.norm(*stats.norm.fit(plot_data))
    fig = viz.probplot(plot_data, ax=ax, plottype='qq', dist=norm,
                       datalabel='Test label')
    return fig
Beispiel #35
0
def test_probplot_pp_probax_y():
    fig, ax = plt.subplots()
    data = setup_plot_data()
    scatter_kws = dict(color='b', linestyle='--', markeredgecolor='g', markerfacecolor='none')
    fig = viz.probplot(data, ax=ax, axtype='pp', otherscale='linear', probax='y',
                       xlabel='test x', ylabel='test y', scatter_kws=scatter_kws)
Beispiel #36
0
def test_probplot_color_and_label(plot_data):
    fig, ax = plt.subplots()
    fig = viz.probplot(plot_data, ax=ax, color='pink', label='A Top-Level Label')
    ax.legend(loc='lower right')
    return fig
Beispiel #37
0
def test_probplot_qq_probax_y():
    fig, ax = plt.subplots()
    data = setup_plot_data()
    fig = viz.probplot(data, ax=ax, axtype='qq', ylabel='Test label', probax='y',
                       otherscale='log', scatter_kws=dict(color='r'))