Skip to content

expressions as annotations broken #6622

@robjhyndman

Description

@robjhyndman

I think this is due to the recent update. It used to work.

library(ggplot2)
ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point() +
  annotate("text", x = 3, y = 30, label = latex2exp::TeX("$\\alpha + \\beta x$"))
#> Error in `annotate()`:
#> ! Problem while setting up geom aesthetics.
#> ℹ Error occurred in the 2nd layer.
#> Caused by error in `list_sizes()` at ggplot2/R/geom-.R:518:3:
#> ! `x$label` must be a vector, not a <latexexpression/expression> object.

Created on 2025-09-18 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions