statisti <- c(68,85,74,88,63,78,90,80,58,63)
math <- c(85,91,74,100,82,84,78,100,51,70)
colors <- c("#FDAE61", # Orange
"#D9EF8B") # Light green
plot(statisti, math,
pch = 19,
col = colors)

hist(math,
freq = FALSE,
main = "time histogram",
xlab = "time")

# Load ggplot2
library(ggplot2)
# Create data
data <- data.frame(
name=c("娛樂休閒","知識閱讀","體育競技","科學創新","公益活動") ,
value=c(185,82,36,28,25)
)
# Barplot
ggplot(data, aes(x=name, y=value)) +
geom_bar(stat = "identity")

# Create Data
Prop <- c(185,82,36,28,25)
# Make the default Pie Plot
pie(Prop)

# Library
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.1 ✔ stringr 1.6.0
## ✔ lubridate 1.9.4 ✔ tibble 3.3.0
## ✔ purrr 1.2.0 ✔ tidyr 1.3.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
# plot
ggplot(data, aes(x=name, y=value)) +
geom_segment( aes(x=name, xend=name, y=0, yend=value)) +
geom_point( size=5, color="red", fill=alpha("orange", 0.3), alpha=0.7, shape=21, stroke=2)
