Plot specific coloured dots

2 次查看(过去 30 天)
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