[R] Shrink Trellis margins settings (when printed to png file)
mark.heckmann at gmx.de
Wed Dec 17 17:11:09 CET 2008
I have two problems:
I want to produce a very small png file (35 x 18 px) that contains a
histogram without a figure region or margins, only the pure heights.
In the base graphic system this is simple:
png(filename = "hist.png", res = 72, width=35, height=18)
Now I want a grid graphics output as I need the graphic as an object.
I tried several trellis.par settings but I was not able to figure it out
Up to now it looks like this:
histogram(rnorm(100), xlab="", ylab="",
This looks acceptable although I would like smaller margins, that is to say
no margins at all. How cab I achieve that?
Now is, that when it is printed to the png file, the graphic almost consist
of margins only. The main part of the plot shrinks to some tiny points.
I don't know how to change the settings, so I that I get the same as in the
Does anyone know?
More information about the R-help