0

I need a plot of 24 lines with different non-repeating colors. How to set different colors for lines (24 lines in total) in the loglog function using a matrix created with distinguishable_colors?

I get the error: Incorrect number assignment. Missing [] around the left hand side.

The dimensions of the elements are the same and equal [1 248].

Code:

col = distinguishable_colors(24);
figure
x = loglog(a1.tau, a1.sm, a2.tau, a2.sm, ..., a24.tau, a24.sm); 
x.Color = col;
  • 1
    I suspect this is because `x` is an array of objects, so the assignment isn't correct. `loglog` should handle this for you if you just call `loglog(x1, y1, x2, y2, ..., 'color', col );` as suggested in the documentation. Alternatively loop over the objects in `x`, and assign the `Color` property of each to the correct row of `col`. – Wolfie May 10 '19 at 16:07
  • Thanks for your answer. I looped objects at x and y, and assigned a color to row of the column. – Uladzislau May 11 '19 at 08:06

0 Answers0