Plot points with different colors based on another array
20 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
William McNair
el 17 de Nov. de 2021
Comentada: Star Strider
el 17 de Nov. de 2021
Hello,
I have 3 arrays of the same length X,Y,intensity.
I would like to plot X and Y with 'x' markers, but I also want to change the color of the marker based on the intensity array (0-100).
Is there an easy way to do this in MATLAB?
Many thanks
0 comentarios
Respuesta aceptada
Star Strider
el 17 de Nov. de 2021
Yes.
x = rand(100,1);
y = rand(100,1);
intensity = randi(99,100,1);
figure
scatter(x, y, 50, intensity, '+')
grid
colormap(turbo)
colorbar
.
4 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Purple en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!