Skip to content

Change in ggsave behaviour #4513

@ecorreig

Description

@ecorreig

I used to "add" ggsave("something.png") to a ggplot object but this has stopped working after version 3.3.3. In case it's been decided that this "feature" wasn't a good idea and the removal was on purpose, please better document that change (even if the possibility to do + ggsave() wasn't documented before; I think many people used it because it might the pipes very elegant).

In short, this worked on 3.3.3:

library(ggplot2)
data.frame(a = rnorm(100), b = rnorm(100)) |> 
  ggplot(aes(a, b)) +
  ggsave("temp.png")

But throws this error on 3.3.4:

Error: Can't add `ggsave("temp.png")` to a ggplot object.

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