[R] sizing and saving graphics in R

michael watson (IAH-C) michael.watson at bbsrc.ac.uk
Thu May 31 10:28:54 CEST 2007


There is also the functions pdf(), jpeg(), bmp() and png() 

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Murray Pung
Sent: 31 May 2007 01:22
To: Felicity Jones
Cc: r-help at stat.math.ethz.ch
Subject: Re: [R] sizing and saving graphics in R

I use the savePlot function for saving graphics. The following will save
the
active graphics panel in your working directory, in format wmf, which I
find
has a high resolution. Check out other possible formats in help.

savePlot(filename = "myfilename",type = c("wmf"))

Murray



On 31/05/07, Felicity Jones <felicity.jones at stanford.edu> 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
>
> ______________________________________________
> R-help at 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
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Murray Pung
Statistician, Datapharm Australia Pty Ltd
0404 273 283

	[[alternative HTML version deleted]]

______________________________________________
R-help at 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
and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list