# ==============================================================================
## Create Box-Plot in R
### Library Package
# library("ggplot2")
### Create Data
groups <- sample(c("GrupA", "GrupB"), size = 100, replace = TRUE)
values <- sample(9:31, 100, replace = TRUE)
df <- data.frame(groups, values)
### Create Plots
ggplot(df, aes(x = groups, y = values, fill=groups)) +
stat_boxplot(geom = "errorbar", width = 0.25) +
geom_boxplot() +
stat_summary(
fun = "mean", geom = "point", shape = 18, size = 4, color = "tomato1"
) +
scale_fill_manual(values=c("peachpuff", "mistyrose")) +
labs(title = "Sample Box-Plot in R (red point = mean) \u00A9ф",
x = "Gruppalar",
y = "Qiymatlar") +
theme_light()+
#theme_minimal() +
theme(legend.position = "none",
plot.title = element_text(color="steelblue4", size=14, face="bold.italic"),
axis.title.x = element_text(color="cadetblue4", size=12, face="bold"),
axis.title.y = element_text(color="tomato4", size=12, face="bold"))