☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Scipy plot pcolormesh in bokeh

Community Support
p-himik
p-himik

Yes, it should be more or less simple to use Bokeh’s image with a color map to create a pcolormesh with a regular grid. But an irregular grid would require some data massaging.

⌁   Link to post
bbflight
bbflight

I think it would be an irregular grid, using this code:

from scipy.fftpack import fft
from scipy.fftpack import fftshift
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

fs = 10e3
N = 1e5
amp = 2 * np.sqrt(2)
time = np.arange(N) / float(fs)
mod = 500np.cos(2np.pi0.25time)
carrier = amp * np.sin(2np.pi3e3*time + mod)
x = carrier

f, t, Sxx = signal.spectrogram(x, fs)

plt.pcolormesh(t, f, Sxx)
plt.ylabel(‘Frequency [Hz]’)
plt.xlabel(‘Time [sec]’)
plt.show()

With the result below…

Figure_1

⌁   Link to post

End of archived discussion · Replies are disabled