-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfragility.R
37 lines (32 loc) · 1.7 KB
/
fragility.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#Coded by Nam Lethanh
# Evolution
data=read.csv("data/fragility.csv", header=T)
attach(data)
#object 1
scalefactor=1
trucy=1
colors=c("red", "darkorchid","green", "violet", "darkorange3","brown3")
plot(data$CS1/scalefactor,pch=16,axes=FALSE,ylim=c(0,trucy),ylab="", xlab="",col="red",type="o",lwd=4)
axis(2, ylim=c(0,trucy),col="darkblue",las=1)
mtext(expression(paste("Probability of failure CS l")),side=2,line=2.2, adj = 0.5 )
axis(1,pretty(range(data$rockfall),10))
mtext(expression(paste("Rock fall volume" (m^3))),side=1,col="black",line=2.2)
box()
par(new=TRUE)
plot(data$CS2/scalefactor,pch=15,axes=FALSE,ylim=c(0,trucy),ylab="", xlab="",col="darkorchid",type="o",lwd=4)
par(new=TRUE)
plot(data$CS3/scalefactor,pch=14,axes=FALSE,ylim=c(0,trucy),ylab="", xlab="",col="green",type="o",lwd=4)
grid(10, 10, col = "lightgray", lty = "dotted",
lwd = par("lwd"), equilogs = TRUE)
legend("topleft",inset=.02,legend=c("i=1","i=2","i=3"),text.col=colors,pch=c(16,15,14),col=colors,horiz=F,bty != "n",bg="white")
text(15, 18.5,expression(paste("I3-GCS1 (14.73x",10^6, "mu-year 15)")),pos=1,cex = 0.8, srt = 0)
text(15, data$CS1[15],"A (0.085)",pos=4,cex = 0.8, srt = 0)
text(15, data$CS2[15],"B (0.224)",pos=4,cex = 0.8, srt = 0)
text(15, data$CS3[15],"C (0.608)",pos=4,cex = 0.8, srt = 0)
points(15,data$CS1[15],pch=23,bg="black",lwd=3)
points(15,data$CS2[15],pch=23,bg="black",lwd=3)
points(15,data$CS3[15],pch=23,bg="black",lwd=3)
segments(15, 0, 15, data$CS3[15], col= 'cadetblue',lty=2,lwd=0.5)
segments(0, data$CS1[15], 15,data$CS1[15], col= 'cadetblue',lty=2,lwd=0.5)
segments(0, data$CS2[15], 15, data$CS2[15], col= 'cadetblue',lty=2,lwd=0.5)
segments(0, data$CS3[15], 15, data$CS3[15], col= 'cadetblue',lty=2,lwd=0.5)