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
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@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@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]]
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
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.