Plot specific coloured dots

2 visualizzazioni (ultimi 30 giorni)
Julien Paare
Julien Paare il 19 Feb 2021
Commentato: Julien Paare il 19 Feb 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 Commento
Julien Paare
Julien Paare il 19 Feb 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.

Accedi per commentare.

Risposta accettata

KSSV
KSSV il 19 Feb 2021
Read about gscatter. Also you can use plot with 'Markercolor' mentioning.

Più risposte (0)

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by