Re: [R] package grid: mirror grob objects along an axis

2012-06-03 Thread baptiste auguie
Hi, Another option that you might want to try is the tikzDevice package; tikz has functions to flip and rotate objects and could it from R with tikzAnnotate / tikzAnnotateGrob. Of course these objects would not really be grobs but tikz code, though for text the end result would probably be the sam

Re: [R] package grid: mirror grob objects along an axis

2012-06-03 Thread Thomas Zumbrunn
My question was answered off list by Paul Murrell, author of 'grid'. Here's am excerpt of our email exchange for the records of R-help. Paul Murrell In some special cases, you would be able to "flip" shapes. If the coordinates of the shapes are given in "native" coordinates,

Re: [R] package grid: mirror grob objects along an axis

2012-05-22 Thread baptiste auguie
Oops, sent too early; this obviously just a rotation, not a mirror image. It illustrates the problem though ;) b. On 23 May 2012 07:32, baptiste auguie wrote: > You can rotate the viewport to flip around the horizontal axis, > > library(grid) > grid.text("Chiral") > grid.text("Chiral", vp=viewpo

Re: [R] package grid: mirror grob objects along an axis

2012-05-22 Thread baptiste auguie
You can rotate the viewport to flip around the horizontal axis, library(grid) grid.text("Chiral") grid.text("Chiral", vp=viewport(angle=180, y=unit(0.5,"npc")-unit(1,"line"))) HTH, b. On 23 May 2012 05:34, Thomas Zumbrunn wrote: > Maybe my question was not concise enough. I was referring to ob

Re: [R] package grid: mirror grob objects along an axis

2012-05-22 Thread Thomas Zumbrunn
Maybe my question was not concise enough. I was referring to objects created with the "package "grid" (also called "grobs"), not to the function "grid" from package "graphics". For instance, let's say I have a polygon createad with grid::polygonGrob and want to mirror it along a specified axis.

Re: [R] package grid: mirror grob objects along an axis

2012-05-22 Thread Rui Barradas
Hello, Just flip 'xlim' or 'ylim'. Or both. Using the iris example in help("grid"), make the following changes: op <- par(mfcol = c(2,2)) # Two columns, first is the original, second flipped. with(iris, [... etc ...] # row 1, col 2: flip x axis plot(Sepal.Length, Sepal.Width,

[R] package grid: mirror grob objects along an axis

2012-05-22 Thread Thomas Zumbrunn
Hi everyone I'd like to flip grobs (grid graphical objects) along an axis, e.g. flip grobs horizontally or vertically. I couldn't find any hints, neither in the documentation nor by searching the web. Does anybody know how to achieve this? Cheers /thomas ___