plot with light to dark blue colour
显示 更早的评论
I have to plot 20 curves . I have stored the data in matrix. I want to color the plot from light blue to dark blue.Please suggest me code
采纳的回答
更多回答(2 个)
x = rand(10, 20) + (1:10).';
figure;
axes('NextPlot', 'add');
color1 = [0.5, 0.5, 1]; % Set colors according to your definition of
color2 = [0, 0, 0.5]; % "light blue" and "dark blue"
m = linspace(0, 1, 10);
for k = 1:10
color = color1 * m(k) + color2 * (1 - m(k));
plot(x(k, :), 'Color', color);
end
Image Analyst
2021-3-22
1 个投票
See my colororder demo. Adapt as needed. The demo lets you pick any built-in colormap, but of course you could use your own if you want.

类别
在 帮助中心 和 File Exchange 中查找有关 Color and Styling 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
