View source: R/geom_buffer_cn.R
geom_buffer_cn | R Documentation |
Creates a ggplot2 layer for displaying buffered areas around China's boundaries, including both the mainland boundary and the ten-segment line. Buffers with user-defined distances are generated around each boundary, providing flexibility in projection and appearance.
geom_buffer_cn(
mainland_dist = 20000,
ten_line_dist = NULL,
crs = "+proj=aeqd +lat_0=35 +lon_0=105 +ellps=WGS84 +units=m +no_defs",
color = NA,
fill = "#D2D5EB",
...
)
mainland_dist |
Numeric. The buffer distance (in meters) for the mainland boundary. |
ten_line_dist |
Numeric. The buffer distance (in meters) for each segment of the ten-segment line. If not specified, it defaults to the same value as 'mainland_dist'. |
crs |
Character. The coordinate reference system (CRS) for the projection. Defaults to "+proj=aeqd +lat_0=35 +lon_0=105 +ellps=WGS84 +units=m +no_defs". Users can specify other CRS strings (e.g., "+proj=merc" for Mercator). |
color |
Character. The border color for the buffer area. Default is 'NA' (transparent). |
fill |
Character. The fill color for the buffer area. Default is '"#D2D5EB"'. |
... |
Additional parameters passed to 'geom_sf'. |
A ggplot2 layer displaying buffered areas around China's boundaries, with customizable buffer distances for the mainland boundary and the ten-segment line, using the specified projection.
# Plot buffers with specified distances for mainland and ten-segment line
ggplot() +
geom_buffer_cn(
mainland_dist = 10000,
ten_line_dist = 5000
) +
theme_minimal()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.