-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththree-pool-model-2D.R
30 lines (28 loc) · 1.21 KB
/
three-pool-model-2D.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
library(reshape2)
library(rgl)
library(colorspace)
library(plotly)
library(plot3D)
library("plot3Drgl")
out_ar <- array(out_total, dim=c(65,18,60))
M <- melt(out_ar)
colors<-rep("black", length(M[,1,]))
colors[M[,1,] > 5 && M[,1,] < 6] <- colorRampPalette(c( "brown"))(sum(M[,,1] > 5 && M[,1,] < 6))
colors[M[,1,] > 7 && M[,1,] < 8] <- colorRampPalette(c( "yellow"))(sum(M[,,1] > 7 && M[,1,] < 8))
colors[M[,1,] > 15 && M[,1,] < 20] <- colorRampPalette(c( "green"))(sum(M[,,1] > 15 && M[,1,] < 20))
# points3d(M, col=colors)
dim(out_ar)
# plot3d(M, col=colors, type = "s", radius = (M$value / 5) )
#
# colors<-rep("black", length(M[,1,]))
# colors[M[,1,] > 5 && M[,1,] < 6] <- colorRampPalette(c( "brown"))(sum(M[,,1] > 5 && M[,1,] < 6))
# colors[M[,1,] > 7 && M[,1,] < 8] <- colorRampPalette(c( "yellow"))(sum(M[,,1] > 7 && M[,1,] < 8))
# (colors[M$value > 15 && M$value < 20] <- colorRampPalette(c( "green"))(sum(M$value > 15 && M$value < 20)))
# points3d(M, col=colors)
rotate <- function(x) t(apply(x, 2, rev))
image(rotate(out_total[,,1]), col=heat.colors(10000), useRaster = TRUE)
hist3D(z = out_total[,,9])
plotrgl()
plotids <- with(iris, hist3D(z = out_total[,,9]))
subid <- currentSubscene3d()
rglwidget(elementId="plot3drgl2")