Skip to content

Plot not saving with {ggplot2 4.0.0} #60

@vidonne

Description

@vidonne

While running {gg_record()} with the new updated {ggplot2 4.0.0} the plot isn't saved and the doesn't appear in the viewer panel. Running the code below will generate the directory but not save the plot. The plot is generated though and will appear in the normal Plot panel instead.

# load packages
library(ggplot2)
library(camcorder)

# record plot
gg_record(
  dir = "temp",
  device = "png",
  width = 7,
  height = 5,
  units = "in"
)

# plot
ggplot(
  mtcars,
  aes(x = hp, y = mpg)
) +
  geom_point() +
  labs(
    title = "Simple scatterplot with ggplot",
    x = "Horsepower (hp)",
    y = "Fuel efficiency (mpg)",
    caption = "Source: mtcars"
  )

Your package is so useful in the plot creation workflow. I hope there is an easy fix to make it compatible with the new {ggplot2} version.
Thanks for all you work on this package!!!
Cedric

R version 4.5.1 (2025-06-13)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 24.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.12.0 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0  LAPACK version 3.12.0

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8        LC_COLLATE=C.UTF-8    
 [5] LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8    LC_PAPER=C.UTF-8       LC_NAME=C             
 [9] LC_ADDRESS=C           LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

time zone: Europe/Berlin
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] camcorder_0.1.0 ggplot2_4.0.0  

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions