I am new in image processing.I know that pixels in the same image are correlated with each other but I don't know how can I draw the relationship b/w these pixels in the form of graph?.
If you would like to show that in natural images, neighboring pixels tend to have similar values, you can use the cooccurrence matrix. The values in the matrix will be distributed mostly along the diagonal.
In the snapshot below, the second image is random and non-correlated. For that image the cooccurrence matrix is pretty much a constant. I'm not showing the matrices themselves, but a plot of their values such that white means '0'.
Try plotting a histogram of all the pixel intensity values in the image to understand the correaltion between the pixels
img = imread('fig.jpg'); imhist(img);
This gives u a histogram showing intensity values to understand the pixel values.. Check this: http://www.mathworks.com/help/images/ref/imhist.html