Skip to content

Commit

Permalink
fixed #1283, format and tick locations for CQT plots
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcfee committed Feb 26, 2021
1 parent 790690c commit 23d3c6c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions librosa/display.py
Expand Up @@ -213,7 +213,7 @@ def __call__(self, x, pos=None):

cents = vmax <= 2 * max(1, vmin)

return core.hz_to_note(int(x), octave=self.octave, cents=cents, key=self.key)
return core.hz_to_note(x, octave=self.octave, cents=cents, key=self.key)


class SvaraFormatter(Formatter):
Expand Down Expand Up @@ -1061,7 +1061,7 @@ def __decorate_axis(axis, ax_type, key="C:maj", Sa=None, mela=None, thaat=None):
axis.set_major_locator(LogLocator(base=2.0, subs=(C_offset,)))
axis.set_minor_formatter(NoteFormatter(key=key, major=False))
axis.set_minor_locator(
LogLocator(base=2.0, subs=2.0 ** (np.arange(1, 12) / 12.0))
LogLocator(base=2.0, subs=C_offset * 2.0 ** (np.arange(1, 12) / 12.0))
)
axis.set_label_text("Note")

Expand All @@ -1085,7 +1085,7 @@ def __decorate_axis(axis, ax_type, key="C:maj", Sa=None, mela=None, thaat=None):
axis.set_major_locator(LogLocator(base=2.0))
axis.set_minor_formatter(LogHzFormatter(major=False))
axis.set_minor_locator(
LogLocator(base=2.0, subs=2.0 ** (np.arange(1, 12) / 12.0))
LogLocator(base=2.0, subs=C_offset * 2.0 ** (np.arange(1, 12) / 12.0))
)
axis.set_label_text("Hz")

Expand Down

0 comments on commit 23d3c6c

Please sign in to comment.