text | R Documentation |
Plots labels, that is a textual (rather than color) representation of values, on top an existing plot (map).
## S4 method for signature 'SpatRaster'
text(x, labels, digits=0, halo=FALSE, ...)
## S4 method for signature 'SpatVector'
text(x, labels, halo=FALSE, inside=FALSE, ...)
x |
SpatRaster or SpatVector |
labels |
character. Optional. Vector of labels with |
digits |
integer. How many digits should be used? |
halo |
logical. If |
inside |
logical. Should the text always be placed inside one the sub-geometries? |
... |
additional arguments to pass to graphics function |
text, plot, halo
r <- rast(nrows=4, ncols=4)
values(r) <- 1:ncell(r)
plot(r)
text(r)
plot(r)
text(r, halo=TRUE, hc="blue", col="white", hw=0.2)
plot(r, col=rainbow(16))
text(r, col=c("black", "white"), vfont=c("sans serif", "bold"), cex=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.