I have a 2D array of spectrogram data which I am scaling with scikit-image for display in a web browser. I would like to scale the array logarithmically in the y-axis."
I can plot the data logarithmically in the y-axis using Matplotlib, but I want access to the 2D array representation of this newly scaled image, but Matplotlib only provides the original, unscaled array. Scikit-image scales 2D arrays linearly, but not logarithmically.
# plot a log-scaled z
w, h = z.shape
fig, ax = plt.subplots()
ax.set_yscale('symlog')
mesh = ax.pcolormesh(np.arange(h+1), np.arange(w+1), z)
# get the array of z
logimg = mesh.get_array().reshape(mesh._meshHeight, mesh._meshWidth)