Skip to content

Commit 11244c5

Browse files
agmurrayteunbrand
andauthored
show.legend for factor data for all levels, even when not observed (#6037)
* Added text to show how to add color to legends for all levels, even when no data for some levels exists. Fixes #5869 * Update R/layer.R edits from Tuen Co-authored-by: Teun van den Brand <49372158+teunbrand@users.noreply.github.com> * Includes edits from Teun to clarify language and ran `devtools::document()` --------- Co-authored-by: Teun van den Brand <49372158+teunbrand@users.noreply.github.com>
1 parent 7572d09 commit 11244c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+123
-41
lines changed

R/layer.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@
5858
#' `NA`, the default, includes if any aesthetics are mapped.
5959
#' `FALSE` never includes, and `TRUE` always includes.
6060
#' It can also be a named logical vector to finely select the aesthetics to
61-
#' display.
61+
#' display. To include legend keys for all levels, even
62+
#' when no data exists, use `TRUE`. If `NA`, all levels are shown in legend,
63+
#' but unobserved levels are omitted.
6264
#' @param inherit.aes If `FALSE`, overrides the default aesthetics,
6365
#' rather than combining with them. This is most useful for helper functions
6466
#' that define both data and aesthetics and shouldn't inherit behaviour from

man/borders.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/geom_abline.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/geom_bar.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/geom_bin_2d.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/geom_blank.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/geom_boxplot.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/geom_contour.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/geom_count.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/geom_density.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)