ColorSelect for Loop-Based Plotting

Provides up to 125 colors, with the goal of keeping adjacent colors distinct.
Updated 8 Feb 2016

View License

ColorSelect provides a pseudorandomized color vector for an input between 1 and 125. Higher or negative numbers will repeat. All colors will not be distinct.
Calling ColorSelect with no argument produces a demo plot, showing all possible colors. Calling ColorSelect with a single argument will produce a color vector that can be used with various plotting functions.
An example of how to call ColorSelect is contained in the function, lines 19-27. Additionally, it is possible to comment out line 35 in case a color gradient is desired.

Cite As

David Guglielmo (2024). ColorSelect for Loop-Based Plotting (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2006a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Loops and Conditional Statements in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

Corrected typos.

Better Title