[R] Reccomendation for graphics package

Gabor Grothendieck ggrothendieck at gmail.com
Fri May 1 20:20:53 CEST 2009


On Fri, May 1, 2009 at 1:55 PM, Zeljko Vrba <zvrba at ifi.uio.no> wrote:
> Hello,
>
> What would you recommend for producing publication-quality plots with R?
> Built-in graphics, trellis, ggplot2, or something else?
>
> Basic requirements:
>
> - I need to draw line-, box-, density-plots, bar-charts and histograms
> - error bars on bar- and box-plots
> - easy tiling of multiple plots on a single "page"
>
> Basic R plotting with mfrow and mfcol parameters is not satisfactory because a
> lot of space is lost on duplicated labels in margins. (In fact, I have not been
> able to figure out how to generate a plot that looks nicely when included in a
> latex document.. short of generating it on a 4x larger area, and including it
> scaled down by 50%.. but that's a separate issue)

Try using par(mar = ...)

opar <- par(mfrow = c(2, 2))
par(mar = c(0, 3, 3, 0))
plot(0, xaxt = "n", xlab = "")
par(mar = c(0, 0, 3, 3))
plot(0, xaxt = "n", yaxt = "n", ylab = "", xlab = "")
par(mar = c(3, 3, 0, 0))
plot(0)
par(mar = c(3, 0, 0, 3))
plot(0, yaxt = "n", ylab = "")
par(opar)

plot.zoo in the zoo package is another example of this.




More information about the R-help mailing list