def plotFit(lnp, p0, p1, p2, ax=None, **kwargs): if ax == None: ax = figure.gca() mody = lnp.mod(lnp.x, p2) ax.plot(lnp.x, mody, label="Best fit", **kwargs) figure.draw_if_interactive()
def plotResiduals(lnp, sampler, p0, p1, p2, ax=None, **kwargs): """ Plot the residuals of the fit """ if ax == None: _ax = figure.gca() else: _ax = ax _ax.errorbar(lnp.x, lnp.y - lnp.mod(lnp.x, p2), yerr=lnp.yerr, **kwargs) if ax == None: _ax.set_xlabel("X") _ax.set_ylabel("Residuals [Data-Model]") figure.theme(ax=_ax) figure.draw_if_interactive()
def plotCI(lnp, sampler, ax=None, **kwargs): """ Plot confidence interval (fill_between) """ if ax == None: _ax = figure.gca() else: _ax = ax for k in range(min(len(sampler.flatchain), 100)): mody = lnp.mod(lnp.x, sampler.flatchain[k, :]) _ax.plot(lnp.x, mody, color="0.", ls="solid", alpha=0.2) figure.draw_if_interactive()
def plotData(lnp, ax=None, **kwargs): """ Do the actual plot of the imput data """ if ax == None: _ax = figure.gca() else: _ax = ax _ax.errorbar(lnp.x, lnp.y, yerr=lnp.yerr, **kwargs) if ax == None: _ax.set_xlabel("X") _ax.set_ylabel("Y") figure.theme(ax=_ax) figure.draw_if_interactive()