Skip to content

Commit

Permalink
geom_function(): x-axis title produced automatically where no data …
Browse files Browse the repository at this point in the history
…is added (#6047)
  • Loading branch information
phispu committed Aug 15, 2024
1 parent ee5c9e5 commit 633e350
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ggplot2 (development version)

* Fixed bug in `stat_function()` so x-axis title now produced automatically
when no data added. (@phispu, #5647).
* geom_sf now accepts shape names (@sierrajohnson, #5808)
* Added `gg` class to `labs()` (@phispu, #5553).
* Missing values from discrete palettes are no longer translated
Expand Down
2 changes: 1 addition & 1 deletion R/stat-function.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ stat_function <- function(mapping = NULL, data = NULL,
#' @usage NULL
#' @export
StatFunction <- ggproto("StatFunction", Stat,
default_aes = aes(y = after_scale(y)),
default_aes = aes(x = NULL, y = after_scale(y)),

compute_group = function(data, scales, fun, xlim = NULL, n = 101, args = list()) {
if (is.null(scales$x)) {
Expand Down

0 comments on commit 633e350

Please sign in to comment.