Je cherche a sauvegarder un graphique trellis en noir et blanc au format wmf. J'utilise win.metafile :
Code : Tout sélectionner
win.metafile(file = paste(myroot, "bias.wmf", sep = ""), width = 5, height = 4.5)
graph1 <- bwplot(
x = rbias2 ~ method | sex + agegroup2,
layout = c(2, 1),
as.table = TRUE,
horizontal = FALSE,
panel = function(...){
panel.bwplot(...)
panel.abline(h = 0, lty = 2)
},
ylab = "Relative bias (%)",
subset = agegroup == 0,
data = datagraph
)
print(graph1, split = c(1, 1, 1, 2), more = TRUE)
graph2 <- bwplot(
x = rbias2 ~ method | sex + agegroup2,
layout = c(2, 1),
as.table = TRUE,
horizontal = FALSE,
panel = function(...){
panel.bwplot(...)
panel.abline(h = 0, lty = 2)
},
ylab = "Relative bias (%)",
subset = agegroup == 1,
data = datagraph
)
print(graph2, split = c(1, 2, 1, 2), more = FALSE)
dev.off()
Mon probleme est que le graphique "bias.wmf" est sauvegarde en couleur.
J'arrive a sauvegarder le graphique en N&B de maniere indirecte : j'utilise "trellis.device(color = 0)", puis click droit de la souris a partir de la fenettre graphique. Par contre je n'arrive pas a trouver le code permettant une sauvegarde directe N&B en wmf. Quelqu'un a-t-il la solution ?
Matthieu