How to plot curve with one color without precising which color it is?

조회 수: 1 (최근 30일)
How can I plot curves with the same color without having to determine exactly what color I want? The plot function is inside a for loop and for each iteration I want to have a group of curves with the same color.

채택된 답변

Philippe Lebel
Philippe Lebel 2019년 12월 11일
aloa
for i = 1:10
if i == 1
h = plot(1:10,1:2*i:20*i)
v = get(h,'Color');
else
plot(1:10,1:2*i:20*i, 'Color', v)
end
hold on
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by