Bonjour,
Tout est dans le titre. En fait, j'aimerais colorier en rouge l'aire sous B10, en orange l'aire entre B25 et B10, etc.
Comment faîtes-vous ?
# vecteurs discrets
B10 = c(0,0.03,0.16,0.29,0.57)
B25 = c(0,0.02,0.15,0.25,0.46)
B50 = c(0,0.02,0.14,0.22,0.35)
B75 = c(0,0.02,0.11,0.18,0.30)
B100 = c(0,0.02,0.08,0.15,0.25)
K=c(10,50,70,100,500)
# lissage
xx <- seq(1,length(B10), len=100)
(bb10 <- smooth.spline(B10,spar=0.3))
BB10 = predict(bb10,xx)$y;
xx <- seq(1,length(B25), len=100)
(bb25 <- smooth.spline(B25,spar=0.3))
BB25 = predict(bb25,xx)$y;
xx <- seq(1,length(B50), len=100)
(bb50 <- smooth.spline(B50,spar=0.3))
BB50 = predict(bb50,xx)$y;
xx <- seq(1,length(B75), len=100)
(bb75 <- smooth.spline(B75,spar=0.3))
BB75 = predict(bb75,xx)$y;
xx <- seq(1,length(B100), len=100)
(bb100 <- smooth.spline(B100,spar=0.3))
BB100 = predict(bb100,xx)$y;
yy <- seq(1,length(K), len=100)
(kk2 <- smooth.spline(K,spar=0.3))
KK = predict(kk2,yy)$y;
# les fameux plots
plot(BB10,KK,t='l', col="red")
points(BB25,KK,t='l', col="orange")
points(BB50,KK,t='l', col="yellow")
points(BB75,KK,t='l', col="green")
points(BB100,KK,t='l', col="blue")
Merci !
Sincèrement,
-----