python - 如何删除使用 librosa.display.specshow 创建的图中的 Y 轴标签、刻度线和轴标签

标签 python image matplotlib data-visualization librosa

我正在使用此代码来可视化梅尔谱图并保存图像

spec = librosa.feature.melspectrogram(y=y,sr=sr,n_mels=128 )
plt.figure(figsize=(12, 6))
spec = librosa.amplitude_to_db(spec, ref=np.max)
librosa.display.specshow(spec, sr=sr, y_coords=None,y_axis='log',fmax=20000)
plt.savefig('spectogram.png')

Click here to view the melspectogram

我无法删除 Y 轴标签、刻度和轴标签并保存它们。

最佳答案

禁用轴:

plt.axis('off')

关于python - 如何删除使用 librosa.display.specshow 创建的图中的 Y 轴标签、刻度线和轴标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62846071/

相关文章:

image - 在 Magento 中以编程方式将图像设置为类别

android - PageCurl(杂志)与来自网络的图像

android - Retrofit2 将图像发布为 base64

python - 如何为子图设置公共(public)轴标签

python - 如何使用Intel RealSense D435创建高度图

python - 运行 Neo4j Python Bolt 驱动程序示例时,错误 :"ImportError: No module named ' _backend'"

python - 如何将我的 Ubuntu python3.7 升级到 python3.8 最新版本?

适用于 Windows、matplotlib 和 opencv 的 Python

python - 如何减慢 Python 中的循环?

python - Python中的成对叉积