can someone tell me which color map is this?

220 views
Skip to first unread message

krishna chauhan

unread,
Aug 17, 2021, 11:00:05 AM8/17/21
to librosa
I want to draw the spectrogram in this colormap, please guide.
Capture1.JPG

Dan Ellis

unread,
Aug 17, 2021, 11:14:02 AM8/17/21
to krishna chauhan, librosa
That's jet, the default colormap for Matlab up until R2014b.  That particular image is only using the top-half of the color range.

Jet is unpopular: It has the unfortunate property that min-value (dim blue) and max-value (dim red) are perceptually close.  The color changes can introduce illusory boundaries.  It's also not particularly colorblind-friendly.  Intensity-ordered colormaps such as viridis are usually preferred.

  DAn.

On Tue, Aug 17, 2021 at 11:00 AM krishna chauhan <krishn...@gmail.com> wrote:
I want to draw the spectrogram in this colormap, please guide.

--
You received this message because you are subscribed to the Google Groups "librosa" group.
To unsubscribe from this group and stop receiving emails from it, send an email to librosa+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/librosa/b0c920a5-5013-4571-b2b1-c7064248235cn%40googlegroups.com.

krishna chauhan

unread,
Aug 17, 2021, 11:43:15 AM8/17/21
to librosa
@dan sir, Thanks a lot I am getting this using the code below :


path=glob.glob('E:/Python_On_All_Dataset/Four emotion_for plot/*.wav') 
fig, ax =  plt.subplots(nrows=4, ncols=3, sharex=True) 

for i in range(4) :
    y, sr = librosa.load(path[i], sr=16000)
    librosa.display.waveplot(y, sr, ax=ax[i, 0])  
    mfcc=librosa.feature.mfcc(y) 
    librosa.display.specshow(mfcc, x_axis='time', ax=ax[i, 1],cmap='viridis')
    S = librosa.feature.melspectrogram(y, sr)
    librosa.display.specshow(librosa.power_to_db(S), x_axis='time', y_axis='log', ax=ax[i, 2],cmap='viridis')  
    plt.axis('off')


The result is image.png


Plz guide how to remove the axis as it's creating the problem, or can I reduce the axis font size? 
Reply all
Reply to author
Forward
0 new messages