Hi Sunil - it sounds like you want to create some sort of bar chart (given your labels for the x- and y-axes) but as an image. Since your tags to this question are image and digital image processing why not create an intensity map with the map being the same size as the image and you use colour to indicate how many times a index has been selected? I know you said "something like an intensity map" - was there a reason why you don't want to use one? If your original matrix is large, then your x-axis (the indices) may not easily show (because too long) the data in a readable/understandable manner. Using the (row,column) "coordinates" of the selected value in the image rather than its index may be more desirable.
Suppose your matrix (that you obtained the indices from) is mxn. Then:
intensities = zeros(m,n); % create the matrix of all zeros
intensities(I1) = I2; % assign the selection count for the indices
imagesc(intensities); % display the intensities as an image
colorbar % display the colorbar to the right of the image
So the above code will display an image the same size as your matrix (original image) with the (default) colorbar indicating in red those indices that are selected the most.
An alternative, which can be manipulated/rotated to return something more like what you asked for, is to use the surf command. Again, suppose that your matrix (that you obtained the indices from) is mxn. Then:
intensities = zeros(m,n); % create the matrix of all zeros
intensities(I1) = I2; % assign the selection count for the indices
surf(intensities); % display the intensities as a 3d surface
colorbar % display the colorbar to the right of the surface
And you can rotate the image as you see fit. Hope that this helps!
