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

Rui Barradas ruipbarradas at sapo.pt
Tue May 22 14:13:35 CEST 2012


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, col = as.integer(Species),
          xlim = c(8, 4), ylim = c(2, 4.5), panel.first = grid(),
          main = "with(iris,  plot(...., panel.first = grid(), ..) )")
     # row 2, col 2: flip y axis
     plot(Sepal.Length, Sepal.Width, col = as.integer(Species),
          xlim = c(4, 8), ylim = c(4.5, 2), 
          panel.first = grid(3, lty=1,lwd=2),
          main = "... panel.first = grid(3, lty=1,lwd=2), ..")

     [... etc ...]
)
par(op)


Hope this helps,

Rui Barradas

Thomas Zumbrunn-3 wrote
> 
> 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
> 
> ______________________________________________
> R-help@ 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.
> 


--
View this message in context: http://r.789695.n4.nabble.com/package-grid-mirror-grob-objects-along-an-axis-tp4630866p4630870.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list