Skip to content

ggproto: Coord cannot be inherited #6133

Closed
@Yunuuuu

Description

@Yunuuuu

I don't know if this should be a valid way to change the internal ggproto value (avoid modifying the data in place)

library(ggplot2)
p <- ggplot(mtcars) +
    geom_point(aes(wt, mpg))
# I want to ensure the coordinate always has clip = "off"
if (!identical(p$coordinates$clip, "off")) {
    # to prevent from changing the input of user.
    p$coordinates <- ggproto(NULL, p$coordinates, clip = "off")
}
print(p)
#> Error in super() : node stack overflow

Created on 2024-10-11 with reprex v2.1.0
~

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