# Creating the Data
Subject = c(rep(c("Hindi", "English", "Math", "Science",
"Computer Science"), times = 4))
Year = c(rep(c("2017-18", "2018-19", "2019-20",
"2020-21"), each = 5))
Students_Passed = c(67,34,23,66,76,66,90,43,45,78,54,
73,45,76,88,99,77,86,56,77)
# Passing the Data to DataFrame
Students_Data = data.frame(Subject,Year,Students_Passed)
# loading the Library
library(ggplot2)
# Plotting the Data in ggplot2
ggplot(Students_Data, aes(x = Year, y = Students_Passed,
fill = Subject, label = Students_Passed)) +
geom_bar(stat = "identity") + geom_text(
size = 5, position = position_stack(vjust = 0.5),colour = "white")