Description Usage Arguments Value Author(s) See Also Examples
Creates an image panel to visualize data in 4, 3 or 2 dimensional arrays (e.g., space-time data).
The function returns a ggplot2
object, which
can be modified using ggplot2 (and/or grid) syntax.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
x |
Numeric array with 4, 3, or 2 dimensions containing the data to be plotted. |
zlim |
Numeric vector of length 2. Gives the upper and lower bound of the plotted values. |
col |
Vector of colors. |
theme |
Logical vector of length one. Should the ggplot2 theme be modified? |
guides |
Logical vector of length one. Should ggplot2 guides be modified? |
na.value |
Vector of length one. The color to be used for NA values. |
panelsByrow |
Logical vector of length one. Indicates the ordering of the panels. |
asRaster |
Logical vector of length one.
If |
xlab |
Character vector (or expression) of length one giving the x-axis label. |
ylab |
Character vector (or expression) of length one giving the y-axis label. |
colbarTitle |
Character vector (or expression) of length one giving the colorbar label. |
... |
Additional arguments are passed to |
Object (plot) of class c("gg", "ggplot2")
.
Florian Gerber, flora.fauna.gerber@gmail.com.
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 | 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")
## End(Not run)
|
Loading required package: ggplot2
--> See ?Gapfill and https://doi.org/10.1109/TGRS.2017.2785240 <--
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.