The third input argument of spectrogram expects the number of samples to overlap each window, not the number of segments. Please try:
winSize = 1000;
overlap = 0;
fftSize = winSize;
[S,F,T,P] = spectrogram(data,winSize,overlap,fftSize,Fs);
It is common practice, however, to set the overlap to half of the window size:
overlap = floor(winSize/2);
but it is not required if you don't want it.