Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在librosa specshow中显示节拍数而不是时间?_Python_Librosa - Fatal编程技术网

Python 如何在librosa specshow中显示节拍数而不是时间?

Python 如何在librosa specshow中显示节拍数而不是时间?,python,librosa,Python,Librosa,我使用librosa计算并显示一个色度图,其中帧按节拍周期聚合 chromagram = librosa.feature.chroma_cqt(y=y_h[in_range], sr=sr) beat_chroma = librosa.util.sync(chromagram, beat_frames, aggregate=np.median) fig,ax = plt.subplots() librosa.display.specshow(beat_chroma, x_axis='time',

我使用librosa计算并显示一个色度图,其中帧按节拍周期聚合

chromagram = librosa.feature.chroma_cqt(y=y_h[in_range], sr=sr)
beat_chroma = librosa.util.sync(chromagram, beat_frames, aggregate=np.median)
fig,ax = plt.subplots()
librosa.display.specshow(beat_chroma, x_axis='time', y_axis='chroma')
ax.set(title='Chromagram aggregated by beats');

x刻度值错误,拍数应为0、1、2、3等,而不是根据默认采样率22k计算的时间。在
x_轴
选项中,我看不到简单显示索引编号的可能性。我所能做的就是隐藏轴心。怎么

我可以显示索引而不是时间吗?我必须在pyplot中手动设置Xtick和Xlabel吗