How to Use "Generate Maximally Perceptually Distinct Colors" Function?

12 views (last 30 days)
I would like to implement Tim Holy's "Generate Maximally Perceptually Distinct Colors" function in my code. I have attempted the following:
colors = distinguishable_colors(100);
plot(t,A(:,j),colors(j,:)); % j is a counter that was defined earlier in the code
xlabel('Time (in days)');
ylabel('Bee Population');
h_xlabel = get(gca,'XLabel');
h_ylabel = get(gca,'YLabel');
hold on
I modeled my attempt after the answer to the following question:
My attempt results in the following error:
Error using plot
Data must be a single matrix Y or a list of pairs X,Y.
Error in AG_Solve_e3v1 (line 77)
The distinguishable_colors function is posted here:
Thank you!

Accepted Answer

Soumya Saxena
Soumya Saxena on 2 Feb 2018

More Answers (0)


Find more on Colormaps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by