2

I am using this code to visualize the melspectogram and save the image

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

I am unable to remove the Y-axis labels, ticks, and the label of the axis and save them.

Zephyr
  • 11,891
  • 53
  • 45
  • 80

1 Answers1

3

Disable the axis all together with:

plt.axis('off')
Parth Shah
  • 1,237
  • 10
  • 24