Skip to content

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #6622 and fix #6638.

Essentially, whenever an expression label comes in, we pack it as a list. In the drawing methods of GeomText and GeomLabel we unpack the list back to expressions. This way, expressions survive internals.

labels <- lapply(labels, `[`, i)
}
if (is.expression(label)) {
label <- unclass(as.list(label))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The unclass() idea is from #6639.
It counters length 1 expression subclasses, which is admittedly a niche problem.

@teunbrand teunbrand added this to the ggplot2 4.0.1 milestone Oct 7, 2025
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.

expressions as tick label broken expressions as annotations broken
1 participant