heights1=c(5,5,4.5,4,4,4,4.5,2,4,4)
opar <- par(lwd = 0.3)
barplot(heights1,xlim=c(0,3), ylim=c(0,5), width=0.1,
main="Langauges(Verbal & Non-verbal)",
names.arg=c("Spanish", "Speak" , "English","Speak", "Hindi",
"Speak", "Arabic", "Speak", "Body Lang", "Speak"), ylab="Skill level ",
xlab="Language starting with mostly used", col=c("darkblue","red"),
cex.names=0.7,space=c(2,0,2,0,2,0,2,0,2,0))
legend("top", c("darkblue","red"), c("reading/Writing", "Speaking") );
Синий - для "чтения/записи", а красный - для "говорящего". Как сделать исправление в легенде? (Я не хочу определять легенду внутри функции barplot)