library(ggplot2)
## Warning: le package 'ggplot2' a été compilé avec la version R 4.2.3
ggplot(data.frame(x = c(-3, 3)), aes(x)) +
  stat_function(fun = pnorm) + 
  stat_function(fun = pnorm, 
                xlim = c(1,3))+
ylab("") + xlab("") +
geom_text(x=2, y=-0.01, label="VaR(h,P)= P-quantile de L") +
  geom_segment(aes(x=0,xend=1,y=0.84134474,yend=0.84134474),
               linetype="dotdash")+
  geom_segment(aes(x=1,xend=1,y=0,yend=0.84134474),
               linetype="dotdash")+
  geom_segment(aes(x = 0, y = 0, xend = 0, yend = 1),
               size=0.5,arrow = arrow(type="closed",length = unit(4, "mm")))+
geom_segment(aes(x=0,xend=3,y=1, yend=1),linetype="dotdash")+
geom_text(x=-0.25, y=1, label="P")+
geom_text(aes(label="F[L](x) == Prob(L[h]<=x) ",
    x = -1.7, y =0.93), parse = T, colour = "black", size = 4)
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Warning in geom_segment(aes(x = 0, xend = 1, y = 0.84134474, yend = 0.84134474), : All aesthetics have length 1, but the data has 2 rows.
## ℹ Did you mean to use `annotate()`?
## Warning in geom_segment(aes(x = 1, xend = 1, y = 0, yend = 0.84134474), : All aesthetics have length 1, but the data has 2 rows.
## ℹ Did you mean to use `annotate()`?
## Warning in geom_segment(aes(x = 0, y = 0, xend = 0, yend = 1), size = 0.5, : All aesthetics have length 1, but the data has 2 rows.
## ℹ Did you mean to use `annotate()`?
## Warning in geom_segment(aes(x = 0, xend = 3, y = 1, yend = 1), linetype = "dotdash"): All aesthetics have length 1, but the data has 2 rows.
## ℹ Did you mean to use `annotate()`?
## Warning in geom_text(aes(label = "F[L](x) == Prob(L[h]<=x) ", x = -1.7, : All aesthetics have length 1, but the data has 2 rows.
## ℹ Did you mean to use `annotate()`?