Plot specific coloured dots

조회 수: 2 (최근 30일)
Julien Paare
Julien Paare 2021년 2월 19일
댓글: Julien Paare 2021년 2월 19일
How can i plot coloured dots ?
A = [9,-5,838;9,-6,1087;10,-4,1669;9,4,747;9,5,925;9,6,973;10,1,1150;9,1,1236;9,3,563;10,-2,1085;10,-1,1150;40,4,787;10,6,750;10,-6,1070];
img = imread('Auto_grid.png');
figure;
imagesc(img);
figure;
scatter(M(:,1), M(:,2), 50, M(:,3), 'Filled')
colormap(jet(size(M,1)))
grid on
the Position in X and Y is saved in the array
the first row are the x values
the second row are the y values
the third row are my calculated values (HIC)
the colour depends on the third row
so if the HIC value :
in the end it should look like the png file in the attachment.
  댓글 수: 1
Julien Paare
Julien Paare 2021년 2월 19일
y =[9 9 9 9 9 9 9 10 10 10 10 10 10 10];
x =[-5 -6 4 5 6 1 3 -4 1 -2 -1 4 6 -6];
hic = [838 1087 1669 747 925 973 1150 1236 563 665 1085 787 750 1070 ];
g={hic};
gscatter(x,y,g,'rygb','*',8,'Age','Weight');
legend('Location','northeastoutside')
thank you for your answer !!
i am still stuck. i do not understand how the groups are formed in the right color.

댓글을 달려면 로그인하십시오.

채택된 답변

KSSV
KSSV 2021년 2월 19일
Read about gscatter. Also you can use plot with 'Markercolor' mentioning.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by