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).
Usage
plot_clc(clo, ...)
# S3 method for class 'clc'
plot_clc(clo, ...)
# S3 method for class 'clc_raster'
plot_clc(clo, ...)
Details
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.
See also
Other CLC class functions:
as_raster()
,
clc()
,
copy_to()
,
cut_to_extent()
,
get_colors.clc()
,
get_levels.clc()
,
get_raster()
,
prepare_plot()
,
save_to()
Examples
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()
#> pdf
#> 2