Skip to content

Commit

Permalink
Hard-code librosa waveshow colors
Browse files Browse the repository at this point in the history
  • Loading branch information
josiah-wolf-oberholtzer committed Oct 27, 2023
1 parent 1f72abc commit bee0c2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion supriya/ext/book.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ def render(cls, node, output_path):
ax.xaxis.label.set_color("white")
ax.tick_params(axis="x", colors="white")
ax.tick_params(axis="y", colors="white")
librosa.display.waveshow(array, sr=sample_rate, ax=ax)
# TODO: Drop color="blue" after upgrading librosa > 0.10.1
# https://github.com/librosa/librosa/issues/1763
librosa.display.waveshow(array, sr=sample_rate, ax=ax, color="blue")
hexdigest = hashlib.sha256(node[0].encode()).hexdigest()
file_path = output_path / f"plot-{hexdigest}.svg"
fig.savefig(file_path, bbox_inches="tight")
Expand Down
4 changes: 3 additions & 1 deletion supriya/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ def render(self):

array, sample_rate = self.plottable.__plot__()
fig, ax = pyplot.subplots(nrows=1)
librosa.display.waveshow(array, sr=sample_rate, ax=ax)
# TODO: Drop color="blue" after upgrading librosa > 0.10.1
# https://github.com/librosa/librosa/issues/1763
librosa.display.waveshow(array, sr=sample_rate, ax=ax, color="blue")
timestamp = (
datetime.datetime.now().isoformat().replace(".", "-").replace(":", "-")
)
Expand Down

0 comments on commit bee0c2a

Please sign in to comment.