Bonjour,

Je voudrais savoir comment sauver un plot en format tiff avec un compression lzw

J'ai essayé deux méthodes, une avec le package grDevice mais ca me donne une image blanche et l'autre avec le package ggplot2 mais je ne sais pas s'il gère le format tiff

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
 
data(iris)
 
library(grDevices)
tiff(filename = "iris_grDevices.tiff",
     width = 5600, height = 5600, units = "px", pointsize = 12,
     compression = "lzw",
     bg = "transparent")
plot(iris$Sepal.Length, iris$Sepal.Width)
dev.off()
#
# j'obtiens une image tout blanc
# 
 
# -----------------------------------------------------------------------------------------------
 
library(ggplot2)
p <- plot(iris$Sepal.Length, iris$Sepal.Width)
ggsave(p, "iris_ggplot2.tiff", dpi=800, compression = "lzw",
       device = "tiff", units = c("mm"),limitsize = FALSE)
#
# Error in UseMethod("grid.draw") : 
#  no applicable method for 'grid.draw' applied to an object of class "character"
#