I have a problem about R, something should be wrong here, I want to add a legend for the two different variables, one is "Insgesamt_ALL" with red colour,and the other one is "weiblich_ALL" with black colour.
> data<-read.csv("DatensatzUE4_01.csv",sep=";",header=T)
> nDATA<-subset(data,data$Fach=='Wirtschaftsingenieurw.m.wirtschaftswiss.Schwerpkt.')
>
> library(ggplot2)
>
> p <- ggplot(data=nDATA,aes(x=Semester,fill=y))
+ ggtitle("GGplot")
+ xlab("Year and Semester")
+ ylab("Total of the student")
+ geom_bar(size=3,aes(y=Insgesamt_ALL,fill=Semester),stat="identity",fill="red")
+ geom_bar(size=3,aes(y=weiblich_ALL,fill=Semester),stat="identity",fill="black")
>
> p2<-p+
theme(panel.background=element_rect(fill="white"),
panel.grid.major=element_line(colour="grey",size=0.1),
plot.title=element_text(face="bold"),
axis.text=element_text(colour="black"),
axis.title.x=element_text(face="bold"),
axis.text.x=element_text(angle=90) )
>
> plot(p2)
Result: