librosa.display not work

2,026 views
Skip to first unread message

Rui Guo

unread,
Jun 28, 2018, 4:59:40 AM6/28/18
to librosa

import librosa, librosa.display, matplotlib.pyplot as plt
y, sr = librosa.load(librosa.util.example_audio_file(), duration=10)
plt.figure()
plt.subplot(3, 1, 1)
librosa.display.waveplot(y, sr=sr)
plt.title('Monophonic')



Text(0.5,1,'Monophonic')

Why it cannot show plot now? I think the old version doesn't has that problem. My version is 0.6.1 now.

librosa.version.show_versions()

INSTALLED VERSIONS
------------------
python: 3.6.4 (default, Mar  1 2018, 18:36:42) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]

librosa: 0.6.1

audioread: 2.1.5
numpy: 1.13.3
scipy: 1.0.0
sklearn: 0.19.1
joblib: 0.11
decorator: 4.3.0
six: 1.11.0
resampy: 0.2.0

numpydoc: 0.7.0
sphinx: 1.6.6
sphinx_rtd_theme: None
sphinxcontrib.versioning: None
matplotlib: 2.1.0
numba: 0.38.1


GUO Rui

unread,
Jun 28, 2018, 5:11:05 AM6/28/18
to librosa

I think the matplotlib cannot work properly now. I upgrade to version 2.2.2 but it still cannot draw.

Brian McFee

unread,
Jun 28, 2018, 10:18:13 AM6/28/18
to librosa
Are you in a notebook?  If so, you might need to say %matplotlib inline to tell it to render plots in the browser.

If not, you'll need to say plt.show() to tell matplotlib to draw the plot (in a window).

GUO Rui

unread,
Jun 28, 2018, 11:38:58 PM6/28/18
to librosa
Yes, I forget to add that line!
Reply all
Reply to author
Forward
0 new messages