-
Notifications
You must be signed in to change notification settings - Fork 1
/
Plotting Stuff.R
60 lines (53 loc) · 1.43 KB
/
Plotting Stuff.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
## Copyright Hien Duy Nguyen - University of Queensland 2016/06/02
COUNT <- 0
for (ii in 1:512) {
for (jj in 1:512) {
if (MASK[ii,jj]==1) {
COUNT <- COUNT + 1
while (min(YY[[COUNT]])< -5.5) {
YY[[COUNT]][which(YY[[COUNT]]< -5.5)] <- YY[[COUNT]][sample(which(YY[[COUNT]] >= -5.5),length(which(YY[[COUNT]]< -5.5)))]
}
}
}
}
CLUSTERING <- apply(TAU,1,which.max)
par(mfrow=c(3,6))
for (gg in 1:17)
{
WHICH <- which(CLUSTERING==gg)
HOLDER <- matrix(NA,length(WHICH),481)
for (ii in 1:length(WHICH)) {
HOLDER[ii,] <- YY[[WHICH[ii]]][10:490]
}
MED <- apply(HOLDER,2,quantile,0.5)
UPPER <- apply(HOLDER,2,quantile,0.975)
LOWER <- apply(HOLDER,2,quantile,0.025)
UNLIST <- unlist(HOLDER)
plot(seq(min(UNLIST),max(UNLIST),length.out=500),main=paste('Cluster',gg),ylab='Y',xlab='',type='n')
lines(10:490,MED,col='black')
lines(10:490,UPPER,col='blue')
lines(10:490,LOWER,col='blue')
}
library(fields)
TABLE_PLOT <- matrix(NA,25,20)
for (ii in 1:25) {
for (jj in 1:20) {
if (ii + jj <= 26) {
TABLE_PLOT[ii,jj] <- TABLE[ii,jj]
}
}
}
image.plot(1:25,1:20,TABLE_PLOT,xlab='g',ylab='p',col=tim.colors(10000))
points(17,3,pch=20,col='white',cex=2)
## Put CLUSTER Back Into original Image
COUNT <- 0
SMOOTH <- matrix(NA,512,512)
for (ii in 1:512) {
for (jj in 1:512) {
if (MASK[ii,jj]==1) {
COUNT <- COUNT + 1
SMOOTH[ii,jj] <- YMEAN[COUNT]
}
}
}
image.plot(SMOOTH)