Hi,
I'm not sure that i've understood you correctly, but the colour of the pixel in intensity graph is determined by the value of the element in your 2D array. If you want to change the color of the pixel with coordinates (i,j) you have to just replace array element in your 2D array with indecies (i,j).
Example is attached.
Good luck.
Oleg Chutko