[R] pointsize in png graphics

Jan.Kleinn@partnerre.com Jan.Kleinn at partnerre.com
Thu Sep 30 16:14:22 CEST 2004


Dear all,

I'm trying to produce 2 png files, one consisting of an image plot and a
color-table (also an image plot) and the other one consisting of 4 image
plots and a color table. I'd like the color table to be exactly the same.
The way I proceded is the following:

for one plot and the color-table
png(file = png.file, width = 650, height = 800, pointsize = 16)
layout(matrix(c(1, 2), ncol = 2, nrow = 1, byrow = T),
       widths = c(6, 1), heights = 1)
par(mar = c(0.2, 0.2, 0.2, 0.2), mgp = c(2, 1, 0), las = 0)
...
dev.off()

for 4 plots and the color-table
png(file = png.file, width = 650, height = 800, pointsize = 16)
layout(matrix(c(1, 2, 5, 3, 4, 5), ncol = 3, nrow = 2, byrow = T),
       widths = c(3, 3, 1), heights = c(1, 1))
par(mar = c(0.2, 0.2, 0.2, 0.2), mgp = c(2, 1, 0), las = 0)
...
dev.off()

The only difference is the layout of the plot. The outcome though is
completely different. It seems that the definition of the size of one point
is different in the two plots as the graphics with 4 plots and color table
has smaller fonts and smaller margins. What do I have to do to be sure the
size of the fonts is the same in two different png graphcis of exactly the
same size when the pointsize is the same?

I'm working with Windows XP and tried both running the R script as a batch
job and running it within Emacs with ESS.

> version
         _
platform i386-pc-mingw32
arch     i386
os       mingw32
system   i386, mingw32
status
major    1
minor    9.1
year     2004
month    06
day      21
language R

Many thanks in advance and best regards, Jan:-)




More information about the R-help mailing list