Facing problem in plotting histogram of DCT coefficient of an image
My guess is that the assertion  


  "the histogram of DCT coefficients of the un-compressed natural image
  has the smooth histogram ... However, the histogram of DCT
  coefficients of the compressed natural image has peaks and gap in it."


is valid when one uses a compression method that uses a DCT (Discrete Cosine Transform), and quantizes (sufficiently) its coefficients. This might not happen for compression methods that differ from JPEG/MPEG principles, that use a 2D DCT. Moreover, JPEG applies DCT2 on $8\times 8$ blocks, and the DC coefficient undergoes a predictive compression scheme different than that of the other AC coefficients.

So I am not surprised that you don't observe quantization when you apply the DCT on the whole image instead of blocks (I obtained the same results).

What could be more successful would be to compare the DCT coefficient histograms (DC coefficient removed) on each of the  $8\times 8$ blocks, raw and compressed, and then combining the coefficients of all the blocks. Here is an attempt, in Matlab.



As you can see, you now have holes in the right-side histograms, due to quantization. 

nBin = 512;
dctCoeffLimit = 80;

img_1 = double(rgb2gray(imread('lena.bmp')));
img_2 = double(rgb2gray(imread('lena.jpg')));

% Compute block DCT with mean removed 
funDCT2 = @(block_struct) dct2(block_struct.data-mean(mean((block_struct.data))));
img_1DCT= (blockproc(img_1,[8 8],funDCT2));
img_2DCT= (blockproc(img_2,[8 8],funDCT2));

% Set DC coefficients to NaN
img_1DCT(1:8:end,1:8:end) = nan;
img_2DCT(1:8:end,1:8:end) = nan;

% Convert 2D to 1D
img_1DCTflat = img_1DCT(:);
img_2DCTflat = img_2DCT(:);

% Remove DC (NaN) values
img_1DCTflat(isnan(img_1DCTflat)) = [];
img_2DCTflat(isnan(img_2DCTflat)) = [];

subplot(1,2,1)
histogram(img_1DCTflat,nBin);axis([-dctCoeffLimit dctCoeffLimit 0 Inf]);
subplot(1,2,2)
histogram(img_2DCTflat,nBin);axis([-dctCoeffLimit dctCoeffLimit 0 Inf]);