[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-help
Subject:    Re: [R] jpeg and pixels
From:       "Marc Schwartz (via MN)" <mschwartz () mn ! rr ! com>
Date:       2006-02-28 22:46:08
Message-ID: 1141166769.5301.13.camel () localhost ! localdomain
[Download RAW message or body]

On Tue, 2006-02-28 at 16:10 -0600, Erin Hodgess wrote:
> Dear R People:
> 
> When using the jpeg function for plotting,
> is there a way to set the size in inches, please?
> 
> There is an option for width and height in pixels, but
> not inches.
> 
> 
> Any suggestions would be welcome!!!!!

The problem is that the size of the resultant image when using bitmaps
is entirely dependent upon the resolution (in pixels per inch) of the
device upon which it is displayed. This is also referred to as dpi or
dots per inch.

Thus, for example, on my system I have a dual display configuration. 

The laptop internal LCD (15 inch diag.) is running at 1600x1200 with a
dpi of 133.

My external LCD display is a 20.1 inch diag., also at 1600x1200, with a
dpi of 98.

Thus, a JPEG image that is 400 pixels x 400 pixels will be roughly 3
inches square on my laptop, but roughly 4 inches square on the external
display.

You need to know the target dpi of the display device and then calculate
the required pixels from there.

An alternative is to use the bitmap() function, where you can specify
height and width arguments, but also need to define the 'res' setting,
which is the dpi desired. Even here, the basic calculation process is
the same:

  Inches = Pixels / DPI


HTH.

Marc Schwartz

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic