Adding addition color to the plot

How can I add additional color to the plot apart from 7 basics color availble . I am using the following code. But it is showing the this error
Error using plot
Specified character vector is an invalid color value.
How can I add this 3 color also to the plot so that all 10 cases color i can assign thank you in advance
load('H1_C1_C2_case1_WLTC_VH_USI86XX_15g_Fuel_EE315_1506_2021_01-Feb-2022_1.mat')
A=xlsread('Same_porosity_new.xlsx','J3:S18002')
time=Temps'
db=[0 0.4470 0.7410] % dark blue
go=[0.9290 0.6940 0.1250] % golden
dr=[0.8500 0.3250 0.0980] % dark red
col=['r' 'g' 'b' 'c' 'm' 'y' 'k' 'db' 'go' 'dr' ];
for i= 1:10
plot(time,A(:,i),'color',col(i))
hold on
xlim([0 200])
end
legend('E0','H0-20','C1-20','C2-20','H0-35','C1-35','C2-35','H0-50','C1-50','C2-50')

 Respuesta aceptada

KSSV
KSSV el 10 de Feb. de 2022
load('H1_C1_C2_case1_WLTC_VH_USI86XX_15g_Fuel_EE315_1506_2021_01-Feb-2022_1.mat')
A=xlsread('Same_porosity_new.xlsx','J3:S18002')
time=Temps'
db=[0 0.4470 0.7410] % dark blue
go=[0.9290 0.6940 0.1250] % golden
dr=[0.8500 0.3250 0.0980] % dark red
col={'r' 'g' 'b' 'c' 'm' 'y' 'k' 'db' 'go' 'dr' };
for i= 1:10
plot(time,A(:,i),'color',col{i})
hold on
xlim([0 200])
end
legend('E0','H0-20','C1-20','C2-20','H0-35','C1-35','C2-35','H0-50','C1-50','C2-50')

6 comentarios

Prasad Joshi
Prasad Joshi el 10 de Feb. de 2022
still not working sir same error it is showing ...Any other way I can used the additional color sir
KSSV
KSSV el 10 de Feb. de 2022
If you want dark red color, you have to give the RGB value.
dr=[0.8500 0.3250 0.0980] % dark red
plot(time,A(:,i),'color',dr)
Prasad Joshi
Prasad Joshi el 10 de Feb. de 2022
Sir But it is plotting for all the plot the same color I tried....I want to differentiate the color for all 10 cases
Prasad Joshi
Prasad Joshi el 10 de Feb. de 2022
Thank you
Prasad Joshi
Prasad Joshi el 13 de Abr. de 2022
Editada: Prasad Joshi el 13 de Abr. de 2022

Iniciar sesión para comentar.

Más respuestas (0)

Preguntada:

el 10 de Feb. de 2022

Editada:

el 13 de Abr. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by