Info

This question is closed. Reopen it to edit or answer.

Color and marker type not correct

1 view (last 30 days)
Ben
Ben on 22 Apr 2016
Closed: Ben on 23 Apr 2016
Why on Earth would the following code produce the attached figure (the figure I attached is the second one; the first has the same incorrect colors and marker shapes)??
point_types = ['rd', 'y^', 'gs', 'bo', 'kv'];
figure
hold on
for i = 1:5
scatter(all_data(yy_idx == i, 1), all_data(yy_idx == i, 2),...
point_types(i), 'filled');
end
hold off
figure
hold on
for i = 1:5
scatter(all_data(km_idx == i, 1), all_data(km_idx == i, 2),...
point_types(i), 'filled');
end
hold off
  1 Comment
Ben
Ben on 23 Apr 2016
Never mind, I figured it out; Matlab was just making a big string instead of an array of strings, so I had to change it to a cell array.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!