library(tidyverse)
library(geomtextpath)
pos_y <- function(x) {sqrt(1 - x^2)}
x = seq(0, 1, by = 0.001)
dta <- tibble(
x = x
) |>
mutate(
y = pos_y(x)
)
dta |>
ggplot(aes(x = x, y = y)) +
geom_line(color = "grey") +
coord_equal() +
labs(x = "Physical Health (Standardised)",
y = "Mental Health (Standardised)",
title = "Health improvement scenarios modelled") +
theme_minimal() +
annotate("point", x = 1, y = 0) +
annotate("point", x = 0, y = 1) +
annotate("point", x = 1/ sqrt(2), y = 1/ sqrt(2)) +
annotate("point", x = 2 / sqrt(5), y = 1 / sqrt(5)) +
annotate("point", x = 1 / sqrt(5), y = 2 / sqrt(5)) +
geom_textcurve(
data = data.frame(x = 0, y = 0, xend = 0, yend = 1),
mapping = aes(x, y, xend = xend, yend = yend),
label = "S1: MH Only",
curvature = 0, hjust = 0.5, arrow = arrow(),
vjust = 0.5
) +
geom_textcurve(
data = data.frame(x = 0, y = 0, xend = 1, yend = 0),
mapping = aes(x, y, xend = xend, yend = yend),
label = "S2: PH Only",
curvature = 0, hjust = 0.5, arrow = arrow(),
vjust = 0.5
) +
geom_textcurve(
data = data.frame(x = 0, y = 0, xend = 1/sqrt(2), yend = 1/sqrt(2)),
mapping = aes(x, y, xend = xend, yend = yend),
label = "S3: Equal Gain",
curvature = 0, hjust = 0.5, arrow = arrow(),
vjust = 0.5
) +
geom_textcurve(
data = data.frame(x = 0, y = 0, yend = 2/sqrt(5), xend = 1/sqrt(5)),
mapping = aes(x, y, xend = xend, yend = yend),
label = "S4: MH Bias",
curvature = 0, hjust = 0.5, arrow = arrow(),
vjust = 0.5
) +
geom_textcurve(
data = data.frame(x = 0, y = 0, yend = 1/sqrt(5), xend = 2/sqrt(5)),
mapping = aes(x, y, xend = xend, yend = yend),
label = "S5: PH Bias",
curvature = 0, hjust = 0.5, arrow = arrow(),
vjust = 0.5
)