ggplot(diamonds, aes(x = price)) +
geom_histogram(binwidth = 500, fill = "skyblue", color = "steelblue") +
labs(
title = "Histogram Harga Berlian",
x = "Harga (USD)",
y = "Frekuensi"
) +
theme_minimal()
ggplot(diamonds, aes(x = price)) +
geom_density(
fill = "skyblue",
color = "steelblue",
alpha = 0.8,
linewidth = 0.2
) +
labs(
title = "Density Plot Harga Berlian",
x = "Harga (USD)",
y = "Kepadatan"
)+
theme_minimal()
ggplot(diamonds, aes(y = price)) +
geom_boxplot(fill = "skyblue") +
labs(
title = "Boxplot Harga Berlian",
y = "Harga (USD)"
) +
theme_minimal()