Modérateur : Groupe des modérateurs
Code : Tout sélectionner
par(xpd=NA)
Logez Maxime a écrit :depuis la version 2.7.2 le paramètre xpd a aussi été ajouté à la fonction légende pour justement permettre de l'intégrer plus facilement dans les marges.
Code : Tout sélectionner
#
# Un plot quelconque reproductible :
#
set.seed(1)
n <- 8
mycols <- rainbow(n)
plot(rnorm(n), rnorm(n), bg= mycols, pch = 21, main = "main", xlab = "xlab", ylab = "ylab", las = 1, cex = 3)
#
# Et un petit coup de legend() en xpd = NA :
#
legend("topright", inset = c(-0.06, -0.15), legend = paste("x", 1:n), xpd = NA, bg = grey(0.9), pch = 21, pt.bg = rainbow(n))
jean lobry a écrit :Logez Maxime a écrit :depuis la version 2.7.2 le paramètre xpd a aussi été ajouté à la fonction légende pour justement permettre de l'intégrer plus facilement dans les marges.
Alors ça, c'est trop cool...
Yves Reecht a écrit :Quelqu'un sait-il si ce changement concerne également d'autres fonctions telles que abline, etc. ?
Code : Tout sélectionner
par(xpd = NA)
CHANGES IN R VERSION 2.7.2
NEW FEATURES
o sprintf() returns elements of the result in UTF-8 when the
format or any character input has a corresponding element
declared as UTF-8. Similarly for paste(), elements of the
result are in UTF-8 when any input to that element is declared
as UTF-8.
o axis() has new arguments 'col.ticks' and 'lwd.ticks' to allow
the colour and line width of ticks to be set separately from
that of the line (e.g. to set one or the other to transparent
or zero width).
o legend() has a new argument 'box.col' to set the colour of the
enclosing box.
o legend() gains a 'xpd' argument to make it easier to place a
legend in the margins or outer margins.
o stripchart() now passes '...' to title() (as well as to
plot.default() and axis()). (Wish of PR#12202)
o help.search() has new argument 'searchEngine' to go
directly to the search form: this is needed by users of
Firefox 3 to workaround a bug in interpreting the search
results pages.
Retourner vers « Questions en cours »
Utilisateurs parcourant ce forum : Aucun utilisateur enregistré et 1 invité