示例#1
0
def test_plot_fit():
    # second
    fig2, ax2 = pyplot.subplots()
    norm_dist = dist.normal(μ=5.4, σ=2.5)
    data = activity.random('normal', μ=5.4, σ=2.5, shape=37)
    ax2 = activity.plot(norm_dist, ax=ax2, line_opts=dict(label='Theoretical PDF'))
    ax2 = activity.plot('normal', data=data, ax=ax2, line_opts=dict(label='Fit PDF'))
    ax2.legend()
示例#2
0
def test_plot_pdf_fit():
    # second
    fig2, ax2 = pyplot.subplots()
    norm_dist = dist.normal(μ=5.4, σ=2.5)
    data = activity.random('normal', μ=5.4, σ=2.5, shape=37)
    ax2 = activity.plot(norm_dist,
                        ax=ax2,
                        line_opts=dict(label='Theoretical PDF'))
    ax2 = activity.plot('normal',
                        data=data,
                        ax=ax2,
                        line_opts=dict(label='Fit PDF'))
    ax2.legend()
    return fig2
示例#3
0
def test_plot_sf_xlog():
    # first
    fig, ax1 = pyplot.subplots()
    loc_dist = dist.lognormal(μ=1.25, σ=0.75)
    ax1 = activity.plot(loc_dist, ax=ax1, xscale='log', which='sf')
    ax1.legend()
    return fig
示例#4
0
def test_plot_sf_xlog():
    # first
    fig, ax1 = pyplot.subplots()
    loc_dist = dist.lognormal(μ=1.25, σ=0.75)
    ax1 = activity.plot(loc_dist, ax=ax1, xscale='log', which='sf')
    ax1.legend()
    return fig
示例#5
0
def test_distplot_lognormal():
    # fourth
    fig4, ax4 = pyplot.subplots()
    data = activity.random('lognormal', μ=0.75, σ=1.2, shape=125)
    logdata = numpy.log10(data)
    bins = numpy.logspace(logdata.min(), logdata.max(), num=30)
    distplot_opts = dict(rug=True, kde=False, norm_hist=True, bins=bins)
    line_opts = dict(color='firebrick', lw=3.5, label='Fit PDF')
    ax4 = activity.plot('lognormal', data=data, distplot=True,
                        xscale='log', pad=0.01, ax=ax4,
                        line_opts=line_opts,
                        distplot_opts=distplot_opts)
示例#6
0
def test_plot_bad_attribute():
    with pytest.raises(AttributeError):
        loc_dist = dist.lognormal(μ=1.25, σ=0.75)
        activity.plot(loc_dist, xscale='log', which='JUNK')
示例#7
0
def test_plot_sf_basic():
    # first
    fig, ax1 = pyplot.subplots()
    norm_dist = dist.normal(μ=5.4, σ=2.5)
    ax1 = activity.plot(norm_dist, ax=ax1, which='sf')
    return fig
示例#8
0
def test_plot_pdf_xlog():
    # first
    fig, ax1 = pyplot.subplots()
    loc_dist = dist.lognormal(μ=1.25, σ=0.75)
    ax1 = activity.plot(loc_dist, ax=ax1, xscale='log')
    return fig
示例#9
0
def test_plot_bad_attribute():
    with pytest.raises(AttributeError):
        loc_dist = dist.lognormal(μ=1.25, σ=0.75)
        activity.plot(loc_dist, xscale='log', which='JUNK')
示例#10
0
def test_plot_sf_basic():
    # first
    fig, ax1 = pyplot.subplots()
    norm_dist = dist.normal(μ=5.4, σ=2.5)
    ax1 = activity.plot(norm_dist, ax=ax1, which='sf')
    return fig
示例#11
0
def test_plot_pdf_xlog():
    # first
    fig, ax1 = pyplot.subplots()
    loc_dist = dist.lognormal(μ=1.25, σ=0.75)
    ax1 = activity.plot(loc_dist, ax=ax1, xscale='log')
    return fig
示例#12
0
def test_plot_distplot():
    # third
    fig3, ax3 = pyplot.subplots()
    data = activity.random('normal', μ=5.4, σ=2.5, shape=37)
    ax3 = activity.plot('normal', data=data, distplot=True, ax=ax3)
    ax3.legend(loc='upper left')
示例#13
0
def test_plot_basic():
    # first
    fig, ax1 = pyplot.subplots()
    norm_dist = dist.normal(μ=5.4, σ=2.5)
    ax1 = activity.plot(norm_dist, ax=ax1)