weight <- c(50,55,63,67,43,52,60)
high <- c(160,170,175,150,153,165,180)
plot(weight,high)
plot(weight,high,
pch=18,
col="#D3A4FF",
xlab="體重",
ylab="身高",
main="班級的身高體重")
library("ggplot2")
# Create data
data <- data.frame(
name=c("A","B","C","D","E") ,
value=c(3,12,5,18,45)
)
# Barplot
ggplot(data, aes(x=name, y=value)) +
geom_bar(stat = "identity") +
coord_flip()