Dear Prof Ripley, Thank you very much for your advice. In fact, I have already tried 'par("din")'. It does not seems to pick up the changes made to the window. For example, I issued the par command after the plot: > par("din") [1] 7.5 7.0 [changed window size] > par("din") [1] 7.5 7.0 The result is exactly the same after changes made to the window. Thanks again. Best wishes, Edmond
>>> Prof Brian Ripley <rip...@stats.ox.ac.uk> 15/02/10 14:35 >>> On Mon, 15 Feb 2010, edmond...@lshtm.ac.uk wrote: > Dear R-listers, > > I am writing a function that will generate a simple plot for the > user . The size of the window (that contains the plot) may not be > what the user wants. > > Supposing the user adjusts the window to a size of her/his choice, I > would like to be able to save the new window size and specify the > plot to be of this new window size when the user calls my function > again. My question is what is the kind of 'get' or save graphic > parameter command that I need to extract the size of the current > window? I have looked at 'par' and 'getOption' but they don't seem > to what I need. >From the help for par: ÌdinÌ _*R.O.*_; the device dimensions, Ì(width,height)Ì, in inches. seems to be exactly what you are asking for. (I'd be cautious about saving this across sessions: users may well use R on different computers with a common file system.) > Many thanks for any advice in advance. > > Best wishes, > Edmond > > > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > Edmond Ng, MSc CStat > Lecturer in Medical Statistics > Health Services Research Unit, London School Hygiene & Tropical Medicine, Keppel Street, London WC1E 7HT, UK > Tel: +44 (0)20 7927 2366 (direct line: ext 2065) Fax: +44 (0)20 7580 8183 > (Room 35, Ground Floor, Malet Street side) > Website: http://www.lshtm.ac.uk/hrsu > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 [[alternative HTML version deleted]]
______________________________________________ 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.