# Load ggplot2 library(ggplot2) # Create data data <- data.frame( name=c("社會","國文","數學","英文","體育") , value=c(65,32,77,98,45) ) # Barplot ggplot(data, aes(x=name, y=value)) + geom_bar(stat = "identity")