How can I programatically create a custom color gradient for a plot or markers?
Show older comments
I would like to create a plot with a color gradient that ranges from red to almost white. For example, I need 5 intermediate colors in a color vector where the darkest color is [1 0 0] and the lightest one is [1 1 1] in such a way that colors = [ [1 0 0] [? ? ?] [? ? ?] [? ? ?] [? ? ?] [? ? ?] [? ? ?] 1 1 1] ]. This means creating a color gradient manually in such a way that it ranges from red to light pink.
What is the simplest way to create this color vector programmatically?
Accepted Answer
More Answers (0)
Categories
Find more on Color and Styling in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
