Looped subplot with different marker face colors for each data point within each subplot
Información
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Mostrar comentarios más antiguos
Hi collective brain,
I am trying to create 24 subplots where colors differ for each data point within each subplot, but are repeated in each subplot. Please see both a screenshot and my code below (working example). As you can see in each subplot all markers are green, although I would like them to be red, green, blue, red, green, blue, red, green (as indicated in vector scatter_clr). How do I fix this? If someone could also help me understand how I can use color triplets, .e.g [1 0 1], instead of characters that would be of great help too.
Thanks in advance for any hints!

x_data = rand(8,24);
y_data = rand(8,24);
scatter_clr = ['r';'g';'b';'r';'g';'b';'r';'g'];
scatter_clr = repmat(scatter_clr,1,24);
figure
for j = 1:8;
for k = 1:24;
subplot(6,4,k)
scatter1 = scatter(x_data(:,k)/1000, y_data(:,k)/1000, [], scatter_clr(j,k),'filled');
end
end
Respuestas (1)
Paul Wolfram
el 20 de Sept. de 2019
La pregunta está cerrada.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
