def plot(self, fig=None, ax=None):
if fig is None:
fig = plt.figure()
if ax is None:
ax = fig.gca()
fmax = self.fs / 2.0
bicoherence = np.copy(self.bicoherence)
n_freq = bicoherence.shape[0]
np.flipud(bicoherence)[np.triu_indices(n_freq, 1)] = 0
bicoherence[np.triu_indices(n_freq, 1)] = 0
bicoherence = bicoherence[:, :n_freq // 2 + 1]
vmin, vmax = compute_vmin_vmax(bicoherence, tick=1e-15, percentile=1)
ax.imshow(bicoherence, cmap=plt.cm.viridis, aspect='auto', vmin=vmin,
vmax=vmax, origin='lower', extent=(0, fmax // 2, 0, fmax),
interpolation='none')
ax.set_title('Bicoherence (%s)' % self.method)
ax.set_xlabel('Frequency (Hz)')
ax.set_ylabel('Frequency (Hz)')
# add_colorbar(fig, cax, vmin, vmax, unit='', ax=ax)
return ax
评论列表
文章目录