Rahul Jaikrishna
Rahul Jaikrishna

Reputation: 25

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

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.

Upvotes: 2

Views: 1180

Answers (1)

Parth Shah
Parth Shah

Reputation: 1475

Disable the axis all together with:

plt.axis('off')

Upvotes: 3

Related Questions