On Mon, Mar 23, 2009 at 7:38 AM, Lo_Lo <tchiba...@hotmail.com> wrote:
> I'm ploting graphics and I'd like to save them as a .jpeg file for example,
> but with a given size (in inches or cm).
>
> I tryed the function windows() but I think it just changes the size of the
> window and not the size of the graph that you're saving.
>
> Then I tryed with the function par(din=(width=... height=...) ) but I guess
> it's protected and I can't change the values.
>
> Finally I tryed with jpeg(file, units="in", width=..., height=...) but R
> asks me for another argument "res" that is supposed to be res=72 dpi or
> res=NA (I found those values in the R-help). It still doesn't work...
> Because of problems of margin, or "can't create a bitmap file" or something
> different again...
>
> Could you give me some advice guys ? It sounds basic to me :) but I'm
> stupidly trapped and I can't find any solutions !!
>
> Thanks a lot

You'll be wanting to call the jpeg() function directly with the width=
and height= arguments.  These are given in pixels, which makes things
a little tricky if you want to measure in inches -- you'll need also
use the "res" argument to set the resolution.  See:

http://blog.revolution-computing.com/2009/01/10-tips-for-making-your-r-graphics-look-their-best.html

for some examples.  I'm guessing you want to print your graphic in
which case jpeg() probably isn't the best choice (it rarely is for
statistical graphics).  See that same post for some other suggestions.

# David Smith

-- 
David M Smith <da...@revolution-computing.com>
Director of Community, REvolution Computing www.revolution-computing.com
Tel: +1 (206) 577-4778 x3203 (Seattle, USA)

Check out our upcoming events schedule at www.revolution-computing.com/events

______________________________________________
R-help@r-project.org 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.

Reply via email to