From 38f5ac113802fbd69eed349e4c8650441e63e127 Mon Sep 17 00:00:00 2001 From: Hugo Gruson Date: Wed, 14 Apr 2021 16:45:25 +0200 Subject: [PATCH 1/3] Add example showing how to use the fill argument in stat_function() --- R/geom-function.R | 2 ++ man/geom_function.Rd | 2 ++ 2 files changed, 4 insertions(+) diff --git a/R/geom-function.R b/R/geom-function.R index 98fba891fc..465264e549 100644 --- a/R/geom-function.R +++ b/R/geom-function.R @@ -32,6 +32,8 @@ #' #' base + stat_function(fun = dnorm, geom = "point", n = 20) #' +#' base + stat_function(fun = dnorm, geom = "density", color = "blue", fill = "blue", alpha = 0.5) +#' #' base + geom_function(fun = dnorm, n = 20) #' #' # Two functions on the same plot diff --git a/man/geom_function.Rd b/man/geom_function.Rd index bcc0d61538..e080c3ca95 100644 --- a/man/geom_function.Rd +++ b/man/geom_function.Rd @@ -130,6 +130,8 @@ base + stat_function(fun = dnorm, geom = "point") base + stat_function(fun = dnorm, geom = "point", n = 20) +base + stat_function(fun = dnorm, geom = "density", color = "blue", fill = "blue", alpha = 0.5) + base + geom_function(fun = dnorm, n = 20) # Two functions on the same plot From c40bed2d6fe7c3a70994d99a8f8325b82fa292e3 Mon Sep 17 00:00:00 2001 From: Hugo Gruson Date: Tue, 9 Nov 2021 09:45:11 +0100 Subject: [PATCH 2/3] Use geom = "polygon" instead of geom = "density" --- R/geom-function.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/geom-function.R b/R/geom-function.R index 465264e549..30b58d8426 100644 --- a/R/geom-function.R +++ b/R/geom-function.R @@ -32,7 +32,7 @@ #' #' base + stat_function(fun = dnorm, geom = "point", n = 20) #' -#' base + stat_function(fun = dnorm, geom = "density", color = "blue", fill = "blue", alpha = 0.5) +#' base + stat_function(fun = dnorm, geom = "polygon", color = "blue", fill = "blue", alpha = 0.5) #' #' base + geom_function(fun = dnorm, n = 20) #' From 79f40b117e3d85682f7b86744fea481b3906222d Mon Sep 17 00:00:00 2001 From: Hugo Gruson Date: Tue, 9 Nov 2021 09:45:47 +0100 Subject: [PATCH 3/3] Run devtools::document() --- man/geom_function.Rd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/geom_function.Rd b/man/geom_function.Rd index e080c3ca95..053808f93f 100644 --- a/man/geom_function.Rd +++ b/man/geom_function.Rd @@ -130,7 +130,7 @@ base + stat_function(fun = dnorm, geom = "point") base + stat_function(fun = dnorm, geom = "point", n = 20) -base + stat_function(fun = dnorm, geom = "density", color = "blue", fill = "blue", alpha = 0.5) +base + stat_function(fun = dnorm, geom = "polygon", color = "blue", fill = "blue", alpha = 0.5) base + geom_function(fun = dnorm, n = 20)