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()
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
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
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)
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')
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
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
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')
def test_plot_basic(): # first fig, ax1 = pyplot.subplots() norm_dist = dist.normal(μ=5.4, σ=2.5) ax1 = activity.plot(norm_dist, ax=ax1)