Plot specific coloured dots

2 vues (au cours des 30 derniers jours)
Julien Paare
Julien Paare le 19 Fév 2021
Commenté : Julien Paare le 19 Fév 2021
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 commentaire
Julien Paare
Julien Paare le 19 Fév 2021
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.

Connectez-vous pour commenter.

Réponse acceptée

KSSV
KSSV le 19 Fév 2021
Read about gscatter. Also you can use plot with 'Markercolor' mentioning.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by