def plot(self, ax=None, write_tau=True):
"""
Returns
-------
fig : matplotlib.figure.Figure
Figure instance containing the plot.
"""
check_is_fitted(self, 'neg_log_likelihood_')
if ax is None:
fig = plt.figure()
ax = fig.gca()
else:
fig = ax.figure
blue, green, red, purple, yellow, cyan = SEABORN_PALETTES['deep']
i_best = np.nanargmin(self.neg_log_likelihood_)
ax.plot(self.delays_ms_, self.neg_log_likelihood_, color=purple)
ax.plot(self.delays_ms_[i_best], self.neg_log_likelihood_[i_best], 'D',
color=red)
ax.set_xlabel('Delay (ms)')
ax.set_ylabel('Neg. log likelihood / T')
ax.grid('on')
if write_tau:
ax.text(0.5, 0.80, r'$\mathrm{Estimated}$',
horizontalalignment='center', transform=ax.transAxes)
ax.text(0.5, 0.66, r'$\tau_0 = %.0f \;\mathrm{ms}$' %
(self.delays_ms_[i_best], ), horizontalalignment='center',
transform=ax.transAxes)
return fig
评论列表
文章目录