Gráfico sencillo de barras apiladas

#INICIO -------------------------
rm(list=ls(all=TRUE))

x1<-c(5,20,33,37,5)
x2<-c(27,29,29,7,8)
x3<-c(36,18,27,10,9)
x4<-c(54,11,7,24,4)

a<-data.frame(x1,x2,x3,x4)
m<-as.matrix(a)

nombres<-c("A","B","C","D")
colores<-c("red","yellow","orange","blue","lightblue")

par(las=2)
barplot(m,horiz=F,names.arg=nombres,col=colores,cex.names=0.7)
title(main=c("Nivel de comprensión lectora en % (centros A, B, C y D)"))
legend("bottomright",c("muy alto","alto","medio","bajo","muy bajo"),fill=c("lightblue","blue","orange","yellow","red"))
#FIN -------------------------

No hay comentarios:

Publicar un comentario