繁体   English   中英

如何在使用 librosa.display.specshow 创建的 plot 中删除 Y 轴标签、刻度和轴 label

[英]How to remove the Y-axis labels, ticks and axis label in a plot created using librosa.display.specshow

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

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')

单击此处查看 melspectogram

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

禁用所有轴:

plt.axis('off')

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM