MATLAB: Spectrogram windowing- why do the 2 methods generate different graphs

spectrogram

Method 1 spectrogram(x,128,16,128,FS)
Method 2 w = window(@hamming,128); [S,F,T,P] = spectrogram(x,w,16,128,FS);
Since I cannot change the window type in method 1, I am using method 2. I would like to know why there is a BIG difference in the figures generated.

Best Answer

That is a different question. The answer to that question is that calling spectrogram() with no output arguments is the same as providing the 'xaxis' option for FREQLOCATION (this is explained in the help).
That means that instead of having frequency on the y-axis as your second figure does and my figures too, you have frequency on the x-axis and time on the y-axis.