color function work in R

Could anyone please explain how color function works in matplot.
Example "matplot(t(data) , type ="b" ,pch = 15:18 ,col=c(1:4,6))"
How does color recognize vector values for 1,2,3,4,6 are which colors ?

I think the colors are selected from the values returned by the palette function.

[1] "black"   "#DF536B" "#61D04F" "#2297E6" "#28E2E5" "#CD0BBC" "#F5C710" "gray62" 
1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.