Answer by KALYAN ACHARJYA
on 4 Aug 2019

Edited by KALYAN ACHARJYA
on 4 Aug 2019

Accepted Answer

image_test=rgb2gray(imread('2.png')); % Change the image

[rows colm]=size(image_test);

original_data=zeros(1,56512);

diag_data=zeros(1,56512);

hor_data=zeros(1,56512);

ver_data=zeros(1,56512);

l=1;

%ignoring boundary elements

for i=2:rows-1

for j=2:colm-1

original_data(l)=image_test(i,j);

diag_data(l)=image_test(i+1,j+1);

hor_data(l)=image_test(i,j+1);

ver_data(l)=image_test(i+1,j);

l=l+1;

end

end

subplot(131),plot( original_data,diag_data,'b.','linewidth',2);

xlabel('n,m'), ylabel('n+1,m+1'),title('Diagonal');

subplot(132),plot( original_data,diag_data,'b.','linewidth',2);

xlabel('n,m'), ylabel('n,m+1'),title('Horizontal');

subplot(133),plot( original_data,diag_data,'b.','linewidth',2);

xlabel('n,m'), ylabel('n+1,m'),title('Vertical');

KALYAN ACHARJYA
on 4 Aug 2019

subplot(131),scatter( original_data,diag_data,'b.','linewidth',2);

%..............^^ would be same result, do in all 3 lines

Parveiz Lone
on 4 Aug 2019

What 56512 indicate ? Or is it m*n size of image

KALYAN ACHARJYA
on 4 Aug 2019

Possible total iterations or

row*colm - ignoring boundary pixels

Sign in to comment.

Answer by Image Analyst
on 3 Aug 2019

You need to use colorcloud(). It does a 3-D scatterplot of the RGB gamut.

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 6 Comments

## darova (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/474692-how-do-i-draw-the-scatterplot-of-an-rgb-image#comment_731439

## Parveiz Lone (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/474692-how-do-i-draw-the-scatterplot-of-an-rgb-image#comment_731524

## darova (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/474692-how-do-i-draw-the-scatterplot-of-an-rgb-image#comment_731544

## Image Analyst (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/474692-how-do-i-draw-the-scatterplot-of-an-rgb-image#comment_731601

## darova (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/474692-how-do-i-draw-the-scatterplot-of-an-rgb-image#comment_731604

## Image Analyst (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/474692-how-do-i-draw-the-scatterplot-of-an-rgb-image#comment_731810

Sign in to comment.