From 8bdfdedd5b23f6149668cac09ec19d28944546b8 Mon Sep 17 00:00:00 2001 From: Thomas Lin Pedersen Date: Mon, 19 Aug 2024 14:25:08 +0200 Subject: [PATCH] Add changes from #4875 --- R/geom-path.R | 3 ++- R/geom-text.R | 5 +++-- man/geom_path.Rd | 3 ++- man/geom_text.Rd | 5 +++-- man/labeller.Rd | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/R/geom-path.R b/R/geom-path.R index 9b737267ca..b63a1a1877 100644 --- a/R/geom-path.R +++ b/R/geom-path.R @@ -36,8 +36,9 @@ #' @examples #' # geom_line() is suitable for time series #' ggplot(economics, aes(date, unemploy)) + geom_line() +#' # separate by colour and use "timeseries" legend key glyph #' ggplot(economics_long, aes(date, value01, colour = variable)) + -#' geom_line() +#' geom_line(key_glyph = "timeseries") #' #' # You can get a timeseries that run vertically by setting the orientation #' ggplot(economics, aes(unemploy, date)) + geom_line(orientation = "y") diff --git a/R/geom-text.R b/R/geom-text.R index d0f33a12ff..22ae141a1c 100644 --- a/R/geom-text.R +++ b/R/geom-text.R @@ -98,10 +98,11 @@ #' scale_colour_discrete(l = 40) #' p + geom_label(aes(fill = factor(cyl)), colour = "white", fontface = "bold") #' -#' p + geom_text(aes(size = wt)) +#' # Scale size of text, and change legend key glyph from a to point +#' p + geom_text(aes(size = wt), key_glyph = "point") #' # Scale height of text, rather than sqrt(height) #' p + -#' geom_text(aes(size = wt)) + +#' geom_text(aes(size = wt), key_glyph = "point") + #' scale_radius(range = c(3,6)) #' #' # You can display expressions by setting parse = TRUE. The diff --git a/man/geom_path.Rd b/man/geom_path.Rd index 8c530e4d33..833ee757c6 100644 --- a/man/geom_path.Rd +++ b/man/geom_path.Rd @@ -205,8 +205,9 @@ the \code{NA} is removed silently, without warning. \examples{ # geom_line() is suitable for time series ggplot(economics, aes(date, unemploy)) + geom_line() +# separate by colour and use "timeseries" legend key glyph ggplot(economics_long, aes(date, value01, colour = variable)) + - geom_line() + geom_line(key_glyph = "timeseries") # You can get a timeseries that run vertically by setting the orientation ggplot(economics, aes(unemploy, date)) + geom_line(orientation = "y") diff --git a/man/geom_text.Rd b/man/geom_text.Rd index 5f5dabe2d0..f50563730c 100644 --- a/man/geom_text.Rd +++ b/man/geom_text.Rd @@ -249,10 +249,11 @@ p + geom_text(aes(colour = factor(cyl))) + scale_colour_discrete(l = 40) p + geom_label(aes(fill = factor(cyl)), colour = "white", fontface = "bold") -p + geom_text(aes(size = wt)) +# Scale size of text, and change legend key glyph from a to point +p + geom_text(aes(size = wt), key_glyph = "point") # Scale height of text, rather than sqrt(height) p + - geom_text(aes(size = wt)) + + geom_text(aes(size = wt), key_glyph = "point") + scale_radius(range = c(3,6)) # You can display expressions by setting parse = TRUE. The diff --git a/man/labeller.Rd b/man/labeller.Rd index 52481179f9..2c863d2aee 100644 --- a/man/labeller.Rd +++ b/man/labeller.Rd @@ -42,7 +42,7 @@ for the argument \code{labeller}. \description{ This function makes it easy to assign different labellers to different factors. The labeller can be a function or it can be a -named character vectors that will serve as a lookup table. +named character vector that will serve as a lookup table. } \details{ In case of functions, if the labeller has class \code{labeller}, it