# NOT RUN {
library("abind")
t1 <- array(rep(c(1,0), each = 5), c(5,5))
t1[5,3] <- 2
t2 <- abind(t1, t1, along = 3)
t3 <- abind(t2, t2, along = 4)
Image(t1)
Image(t2)
Image(t3)
# }
# NOT RUN {
Image(ndvi)
p1 <- Image(ndvi, colbarTitle = "NDVI", xlab = "Year", ylab = "DOY",
panelsByrow = FALSE)
p1
p2 <- Image(ndvi[,,3,2], na.value = "white", colbarTitle = "NDVI") +
theme(strip.text.x = element_blank(),
strip.text.y = element_blank(),
panel.border = element_rect(fill = NA, size = 1))
p2
## place modified color bar left
p2 + guides(fill = guide_colorbar(title = "NDVI",
barwidth = 1,
barheight = 20,
label.position = "right",
legend.position = c(0, 0))) +
theme(legend.position = "right")
## place color bar at bottom
p2 + guides(fill = guide_colorbar(title = "NDVI",
barwidth = 7,
barheight = .7,
label.position = "bottom",
legend.position = c(0, 0)),
direction = "horizontal") +
theme(legend.position = "bottom")
# }
Run the code above in your browser using DataLab