how I can insert these specific colours into my figures

1 次查看(过去 30 天)
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 中查找有关 Interactive Control and Callbacks 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by