plot_clc | R Documentation |
Plot CLC data stored in objects of supported classes. The function adapts the plot based on the class of the input data (vectorial or raster format).
plot_clc(clo, ...)
## S3 method for class 'clc'
plot_clc(clo, ...)
## S3 method for class 'clc_raster'
plot_clc(clo, ...)
clo |
An object containing CLC data. This must be an instance of a supported class, such as: - A vectorial CLC data object (e.g., 'clc' object). - A raster CLC data object (e.g., 'clc_raster'). |
... |
Additional arguments passed to the 'terra::plot' function. |
For the raster version, the 'terra::plot' function is used with the 'col' parameter configured, while all other parameters supported by the function can also be defined (using '...').
For the vector version, 'ggplot2::ggplot' is used, and by using the 'prepare_plot' function instead of this one ('plot_clc'), further customization can be applied as needed.
A 'ggplot2' object or a 'terra' plot.
prepare_plot
Other CLC class functions:
as_raster()
,
clc()
,
copy_to()
,
cut_to_extent()
,
get_colors.clc()
,
get_levels.clc()
,
get_raster()
,
prepare_plot()
,
save_to()
source_gpkg <- system.file("extdata", "clc.gpkg", package = "clc")
clo <- clc(source = source_gpkg, layer_name = "clc")
temp_file <- tempfile(fileext = ".png")
png(filename = temp_file, width = 800, height = 600)
clo |>
plot_clc()
dev.off()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.