Skip to contents

These scales map the categories of a variable to the styles drawn by geom_urban_square(). scale_style_discrete() is the default, and uses the styles in a fixed order: "outline", "frame", "fill", "hollow", "quarter". scale_style_manual() gives the style of each category explicitly, and scale_style_identity() uses a column that already holds style names.

Usage

scale_style_discrete(name = ggplot2::waiver(), ..., guide = "legend")

scale_style_manual(name = ggplot2::waiver(), ..., values, guide = "legend")

scale_style_identity(name = ggplot2::waiver(), ..., guide = "none")

Arguments

name

The legend title.

...

Other arguments passed on to ggplot2::discrete_scale(), ggplot2::scale_discrete_manual(), or ggplot2::scale_discrete_identity().

guide

The legend type.

values

For scale_style_manual(), a character vector of styles, named by category.

Value

A ggplot2 scale.

Examples

library(ggplot2)

cells <- data.frame(x = 1:5, y = 1, use = letters[1:5])
ggplot(cells, aes(x, y, style = use)) +
  geom_urban_square() +
  coord_equal()