Skip to contents

Plot a sf or sfc object with hatching

Usage

plot_density(x, density = NULL, angle = 45, col = NA, border = NULL)

Arguments

x

sf or sfc object

density

numeric, the density of shading lines, in lines per inch.

angle

numeric, the slope of shading lines, given as an angle in degrees (counter-clockwise).

col

character, the color of the shading lines.

border

character, the color to draw the border.

Value

Nothing useful.

Details

The function makes a call to polygon() after some transformations of the sf (or sfc) object. It will plot something only if all geometry types of x are 'MULTIPOLYGON'. In the other case, it will just send a warning.

All rendering parameters can be set for original number of features. More details are to be found in polygon() help.

Examples


map_so_ii()
plot_density(so_ii_collectivity)
plot_density(
 so_ii_collectivity,
 density = c(10,20),
 col = c("black", "blue", "green"),
 border = "gray",
 angle = seq(nrow(so_ii_collectivity))
)