Image(ndvi)
p1 <- Image(ndvi, colbarTitle = "NDVI", byrow = 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 = "left",
legend.position = c(0, 0))) +
theme(legend.position = "left")
## 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