[R] How to rotate any plot in R

Gabor Grothendieck ggrothendieck at gmail.com
Sat Sep 9 21:05:54 CEST 2006


With lattice or any grid graphics-based plot we can
draw it in a rotated viewport:

library(lattice)
library(grid)
grid.newpage()
pushViewport(viewport(angle = 90, name = "VP"))
upViewport()
x <- 1:10
print(xyplot(x ~ x, groups = gl(2, 5), auto.key = TRUE), draw.in = "VP")

or

grid.newpage()
pushViewport(viewport(angle = 90))
x <- 1:10
print(xyplot(x ~ x, groups = gl(2, 5), auto.key = TRUE), newpage = FALSE)
upViewport()

On 9/9/06, stat stat <stat700004 at yahoo.co.in> wrote:
> Dear all R users,
>
>  I am wondering whether it is possible in R to rotate any plot like Histogram, scatter plot, correlogram etc along with their legend, comments etc.
>
>  Thanks and regrads,
>  stat
>
>
> ---------------------------------
>  Find out what India is talking about on  - Yahoo! Answers India
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list