Skip to content
Snippets Groups Projects
Commit 9c90ab7e authored by ferrari's avatar ferrari
Browse files

Fix bugs

parent bebba4ca
No related branches found
No related tags found
No related merge requests found
......@@ -310,7 +310,7 @@ class Callback(object):
self.curr_ind[self.curr] = len(self.offset) - 1
self.curr_vert[self.curr] = 0
self.cursor[self.curr].linev[0].set_linestyle('--')
self.cursor[self.curr].linev[1].set_linestyle('--')
self.cursor[self.curr].linev[self.cursor[self.curr].num_cur].set_linestyle('--')
for i in range(4):
if i < 2:
ax_group[i].set_visible(False)
......@@ -470,15 +470,15 @@ class Callback(object):
plt.draw()
def increase_freq(self, event):
lim = self.view_data[0].specgram.get_ylim()[1] + 1e3
lim = self.view_data[0].spectrogram.axes.get_ylim()[1] + 1e3
for ax_group in self.view_data:
ax_group.specgram.set_ylim(0, lim)
ax_group.spectrogram.axes.set_ylim(0, lim)
plt.draw()
def decrease_freq(self, event):
lim = max(self.view_data[0].specgram.get_ylim()[1] + 1e3, 1e3)
lim = max(self.view_data[0].spectrogram.axes.get_ylim()[1] - 1e3, 1e3)
for ax_group in self.view_data:
ax_group.specgram.set_ylim(0, lim)
ax_group.spectrogram.axes.set_ylim(0, lim)
plt.draw()
def _update_spectrogram(self, ax_group):
......@@ -612,6 +612,7 @@ class AxesGroup:
tuple(ax_spec.axvline(0.01, c='k') for _ in range(num_cur)))
self.spectrogram.im.set_clim(2000, 2100)
ax_spec.set_ylim(0, min(20e3, sr/2))
ax_spec.set_yticks(ax_spec.get_yticks()) # Needed, otherwise updating ylim doesn't update ticks properly
ax_spec.set_yticklabels((ax_spec.get_yticks() / 1e3).astype(int))
self.correlation = AxesWithCursor(ax_corr,
ax_corr.plot(np.linspace(0, 10, int(10e-3 * sr), False),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment