how I can insert these specific colours into my figures

조회 수: 1 (최근 30일)
Matthew Worker
Matthew Worker 2021년 6월 9일
편집: Rena Berman 2021년 12월 16일
newcolors = [0 0.4470 0.7410
0.8500 0.3250 0.0980
0.9290 0.6940 0.1250
0.25 0.80 0.54
1 0.4470 0.7410
1 0.6940 0.7410
0.4940 0.2840 0.5560
0.7 0.6 0.6
0.3010 0.7450 0.9330
0.7350 0.0780 0.1840];
colororder(newcolors)
figure(1)
legendString = "N = " + string(N);
plot_T = plot(K,C_T,'-O','LineWidth',2);
grid on
title('Total Capacity of the System')
xlabel('Number of Users')
ylabel('Total Capacity (bit/s/Hz)')
legend(plot_T,legendString)
figure(2)
legendString = "K = " + string(K);
plot_L = plot(N,C_T,'-O','LineWidth',2);
grid on
title('Total Capacity of the System')
xlabel('Number of Elements')
ylabel('Total Capacity (bit/s/Hz)')
legend(plot_L,legendString)

채택된 답변

Alan Stevens
Alan Stevens 2021년 6월 9일
Do you mean something like this?
newcolors = [0 0.4470 0.7410;
0.8500 0.3250 0.0980;
0.9290 0.6940 0.1250;
0.25 0.80 0.54;
1 0.4470 0.7410;
1 0.6940 0.7410;
0.4940 0.2840 0.5560;
0.7 0.6 0.6;
0.3010 0.7450 0.9330;
0.7350 0.0780 0.1840];
x = 0:pi/50:2*pi;
[r,c] = size(newcolors);
for i=1:r
y = i*sin(i*x);
plot(x,y,'color', newcolors(i,:));
hold on
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by