필터 지우기
필터 지우기

how to Change Colors and Name of A plotting Figure ?!

조회 수: 3 (최근 30일)
Ahmed
Ahmed 2013년 2월 12일
col='rgbkcmyrgbcmyk';
%figg='16 24 32 66 16 181 2323 5658 1755 12 3135 15 26 212 123 548 32 15 563 548';
for ch=1:Nmax:Nmax*Smax
figure
hold on
iii=1;
for k3=ch:1:(Nmax+ch-1)
plot(dpp,Hamdy(:,k3),'color',col(iii),'Marker','o','LineStyle','--','markerfacecolor',col(iii),'Markersize',6)
legend({'N=1','N=2','N=3','N=4','N=5','N=6','N=7','N=8','N=9','N=10','N=11','N=12','N=13','N=14','N=15','N=16','N=17','N=18','N=19','N=20','N=21','N=22','N=23','N=24'},'location','NorthEast')
xlabel('Plunger Size (in)');
ylabel('Pump Dispacment(BPD)');
set(gca,'xlim',[1.06 max(dpp(dmax+1))])
iii=iii+1;
end
end
the problem is in the Identifing Of Col'rgb' when there are 14 line there may be 2 lines of the same color, want to give every line a different COlor, and if it is possible give every figure A Name or Tiltle Rather than fig1 fig2 ... please Help ??
  댓글 수: 5
Jan
Jan 2013년 2월 12일
@Ahmed: There is only a small number of colors, which can be defined by a character like 'r', 'g', 'b' etc. But you can define millions of colors by using RGB vectors like [1.0, 0.5, 0.3].
Ahmed
Ahmed 2013년 2월 12일
@jan, aha Thank you jan so if i want for examples to set 10 colors before going to the for loop what should i do say i want x=Color [1 0.5 1] then y = [] , then using thisColors in the col='xy' property !, can this work cuz the other code i cant use it in this code

댓글을 달려면 로그인하십시오.

채택된 답변

Jan
Jan 2013년 2월 12일
편집: Jan 2013년 2월 12일
NameList = {'alpha', 'Berta', 'Carla', 'Desiree', 'Emil'}
for iFig = 1:5
figure('NumberTitle', 'off', 'Name', NameList{iFig});
end
  댓글 수: 2
Ahmed
Ahmed 2013년 2월 12일
thx sir
Ahmed
Ahmed 2013년 2월 12일
you are great Man Jan thank you alot :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by