Hello guys,
I need help with labeling the x-axis of my barplot. I used "names.arg" for showing the years of the values, but I also want to show the names of the different barplots. I would need a second layer of "names.arg" to show the names, but I haven't found a function to do it.
quotenDE<-c(27.67097, 27.98674, 41.27499, 37.12439 ,44.32205, 46.22212, 43.76696 ,47.14954)
quotenDEMIGRA<-c(18.76790 ,20.40880 ,27.84180, 25.03935, 32.47452, 37.10825 ,34.26004 ,46.01934)
quotenAusland<-c(13.35735, 18.02211, 24.23222 ,21.30554, 23.74047, 23.48691, 27.96400, 38.82470)
jahre2<-c("2003", "2007", "2007" ,"2010", "2012", "2014", "2016" ,"2018")
##barplot
Migraquoten<-cbind(quotenDE, quotenDEMIGRA, quotenAusland)
migra<-as.matrix(Migraquoten)
JahreMigra<-cbind(jahre2, jahre2,jahre2)
MIGRA<-barplot(Migraquoten,
beside=T,
names.arg=JahreMigra,
col=c('lightblue', 'lightblue', "cyan4", "cyan4", "cyan4", "cyan4", "cyan4", "cyan4"),
ylim=c(0,60),
xpd=FALSE,
ylab="Beteiligung in %",
las=2,
main="Berufsbezogene Weiterbildung in Deutschland 2003-2018 nach Migrationshintergrund",
cex.axis = 0.8, cex.names = 0.7)
text(MIGRA, Migraquoten-2, round(Migraquoten, 1), col = "black", cex=0.6)
legend("topleft", c("BSW", "AES"), pch=15, col=c("lightblue", "cyan4"),
cex=1.3, bty = "n", y.intersp = 1)
Thank you in advance.