[R] sizing and saving graphics in R

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu May 31 08:25:17 CEST 2007


Why not plot directly to a bitmapped format, using bmp() or png()?
That way you can create a large 'display region' when you open the device.

BTW, I guess you are on Windows but you did not say so: bmp() only exists 
on Windows.

On Wed, 30 May 2007, Felicity Jones wrote:

>
> Dear R wizards,
>
> I am seeking advice on graphics in R.  Specifically, how to manipulate
> the size and save a plot I have produced using the LDheatmap library.
> I confess I am relatively new to graphics in R, but I would greatly
> appreciate any suggestions you may have.
>
> LDheatmap produces a coloured triangular matrix of pairwise
> associations between 600 genetic markers in my dataset.  Initially the
> graphical output was confined to the computer screen, such that each
> pairwise marker association was displayed as approximately 1 pixel
> (too small for me to interpret).
>
> I have successfully managed to play with the LDheatmap function to
> enlarge the size of viewport by changing the following code in
> LDheatmap
>
> #From
>
> heatmapVP <- viewport(width = unit(0.8, "snpc"), height = unit(0.8, "snpc"),
>                        name=vp.name)
>
> #To
> heatmapVP <- viewport(width = unit(25, "inches"), height = unit(25,
> "inches"), name=vp.name)
>
> This produces a much larger plot (so big that the majority is not seen
> on the screen).  I would like to save the entire thing so that I can
> import it into photoshop or some other image software.
>
> My problem is that when I save using the R graphics console
> (File->Save As->bmp), it only saves the section I can see on the
> screen.  Any suggestions on how to save the whole plot or manipulate
> the plot so I get higher resolution would be much appreciated.
>
> Thanks for your help in advance,
>
> Felicity.

> Dr Felicity Jones
> Department of Developmental Biology
> Stanford University School of Medicine
> Beckman Center
> 279 Campus Drive
> Stanford CA 94305-5329
> USA

-- 
Brian D. Ripley,                  ripley at 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



More information about the R-help mailing list