set.seed(7777)
vc <- matrix(c(1, 0, 0, 1), ncol = 2, byrow = T)
d <- as_tibble(rmvnorm(500, sigma = vc))
p1 <- ggplot(d, aes(x = V1, y = V2)) +
geom_point() +
theme_void() +
theme(
aspect.ratio = 1,
plot.background = element_rect(fill = "gray90")
)
vc <- matrix(c(1, 0.4, 0.4, 1), ncol = 2, byrow = T)
d <- as_tibble(rmvnorm(500, sigma = vc))
p2 <- ggplot(d, aes(x = V1, y = V2)) +
geom_point() +
theme_void() +
theme(
aspect.ratio = 1,
plot.background = element_rect(fill = "gray90")
)
vc <- matrix(c(1, 0.6, 0.6, 1), ncol = 2, byrow = T)
d <- as_tibble(rmvnorm(500, sigma = vc))
p3 <- ggplot(d, aes(x = V1, y = V2)) +
geom_point() +
theme_void() +
theme(
aspect.ratio = 1,
plot.background = element_rect(fill = "gray90")
)
vc <- matrix(c(1, 0.8, 0.8, 1), ncol = 2, byrow = T)
d <- as_tibble(rmvnorm(500, sigma = vc))
p4 <- ggplot(d, aes(x = V1, y = V2)) +
geom_point() +
theme_void() +
theme(
aspect.ratio = 1,
plot.background = element_rect(fill = "gray90")
)
vc <- matrix(c(1, -0.2, -0.2, 1), ncol = 2, byrow = T)
d <- as_tibble(rmvnorm(500, sigma = vc))
p5 <- ggplot(d, aes(x = V1, y = V2)) +
geom_point() +
theme_void() +
theme(
aspect.ratio = 1,
plot.background = element_rect(fill = "gray90")
)
vc <- matrix(c(1, -0.5, -0.5, 1), ncol = 2, byrow = T)
d <- as_tibble(rmvnorm(500, sigma = vc))
p6 <- ggplot(d, aes(x = V1, y = V2)) +
geom_point() +
theme_void() +
theme(
aspect.ratio = 1,
plot.background = element_rect(fill = "gray90")
)
vc <- matrix(c(1, -0.7, -0.7, 1), ncol = 2, byrow = T)
d <- as_tibble(rmvnorm(500, sigma = vc))
p7 <- ggplot(d, aes(x = V1, y = V2)) +
geom_point() +
theme_void() +
theme(
aspect.ratio = 1,
plot.background = element_rect(fill = "gray90")
)
vc <- matrix(c(1, -0.9, -0.9, 1), ncol = 2, byrow = T)
d <- as_tibble(rmvnorm(500, sigma = vc))
p8 <- ggplot(d, aes(x = V1, y = V2)) +
geom_point() +
theme_void() +
theme(
aspect.ratio = 1,
plot.background = element_rect(fill = "gray90")
)
grid.arrange(p1, p2, p3, p4, p5, p6, p7, p8, ncol = 4)