Request: Example to plot an audio Spectrogram (similar to Matplotlib pcolormesh) in Jupyter Notebook

Hello Bokeh users,

I want to create an interactive version of an audio Spectrogram in a Jupyter Notebook where the user can click on the Spectrogram and have the audio jump to that location.

The plot would have a red line over the Spectrogram that indicates where the audio currently is in real-time.

Also, I want to sync some other plots (audio information for the current timestamp), therefore Bokeh seems more appropriate than Matplotlib.

The part I want to know now is how to plot a Spectrogram with Bokeh.

With Matplotlib you would use [matplotlib.pyplot.pcolormesh](

As example, take a look at the Librosa library for audio that makes use of this:

I tried to run the Spectrogram example found here:

However, I ran into a deprecated error ( and this example is also without Jupyter Notebook.

I found this stackoverflow question:

However, it doesn’t seem that straightforward and not sure if this is the right approach?


In GeoViews a QuadMesh function is added in version 1.5:

Which is described as “GeoViews now also has a QuadMesh element (akin to matplotlib’s pcolormesh).”

Therefore, that seems like a useful function?

In this HoloViews Github issue an user used this QuadMesh approach, but mentioned he couldn’t share the full code:


There are many snippets around how to do a Spectrogram with Bokeh, but since I don’t have experience with Bokeh yet, it’s kinda hard to wrap my head around it.

It would be very helpful if someone could add a Spectrogram example to Bokeh notebooks here:

or any other advice / link to a tutorial that would help me get started.

Thank you for reading.