Skip to content

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #6463.

Briefly, function-labels are formatted as <function> so they don't mess with text formatting.
Example from reprex, note the warning about unknown labels:

library(palmerpenguins)
devtools::load_all("~/packages/ggplot2/")
#> ℹ Loading ggplot2

penguins |> 
  ggplot() +
  geom_histogram(aes(x = flipper_length_mm)) +
  labs(
    x = snakecase::to_sentence_case,
    y = snakecase::to_sentence_case,
    fill = snakecase::to_sentence_case,
  )
#> Warning: Ignoring unknown labels:
#> • fill : <function>
#> `stat_bin()` using `bins = 30`. Pick better value `binwidth`.
#> Warning: Removed 2 rows containing non-finite outside the scale range
#> (`stat_bin()`).

Created on 2025-05-28 with reprex v2.1.1

@teunbrand teunbrand added this to the ggplot2 4.0.0 milestone May 28, 2025
Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@teunbrand teunbrand merged commit f7da3b4 into tidyverse:main Jun 3, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Could the new functional way of setting labs be okay when the applicable aesthetic is not present?
2 participants