Hi R Users, I'm using following sample code to save png plots. png(file="sample.png", width=8, height=6) Then I copy or use "insert pictures" function to get the image into MS Word. After copying, if I try to stretch or re-size the image it starts getting distorted. Is there a way to standardized graph pixels so that the sharpness of the graph is maintained (at least for minor stretching/re-sizing). Is it possible to achieve this? I know I can change width and height, but I have to submit this .doc file to my adviser and he may need to re-size it. Any suggestion would be highly appreciated, Thanks, Wenjie [[alternative HTML version deleted]]
On Dec 19, 2009, at 1:28 PM, Wenjie Lee wrote:> Hi R Users, > > I'm using following sample code to save png plots. > > png(file="sample.png", width=8, height=6) > > Then I copy or use "insert pictures" function to get the image into > MS Word. > After copying, if I try to stretch or re-size the image it starts > getting > distorted. Is there a way to standardized graph pixels so that the > sharpness of the graph is maintained (at least for minor > stretching/re-sizing). Is it possible to achieve this? > > I know I can change width and height, but I have to submit this .doc > file to > my adviser and he may need to re-size it. > > Any suggestion would be highly appreciated,Use pdf().> > Thanks, > Wenjie > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.David Winsemius, MD Heritage Laboratories West Hartford, CT
On 19/12/2009 1:28 PM, Wenjie Lee wrote:> Hi R Users, > > I'm using following sample code to save png plots. > > png(file="sample.png", width=8, height=6) > > Then I copy or use "insert pictures" function to get the image into MS Word. > After copying, if I try to stretch or re-size the image it starts getting > distorted. Is there a way to standardized graph pixels so that the > sharpness of the graph is maintained (at least for minor > stretching/re-sizing). Is it possible to achieve this? > > I know I can change width and height, but I have to submit this .doc file to > my adviser and he may need to re-size it. > > Any suggestion would be highly appreciated, >If you want to resize the graphic, you shouldn't use a bitmap format. Use .pdf, .eps, .wmf, etc. It's still best to generate the graph at the final size (to get fonts and line widths right), but you'll get better results than with resizing a bitmap. I don't know which vector formats your advisor's version of MS Word supports, but presumably their docs will tell you. Duncan Murdoch
You can: 1. Right click the graphic and choose copy metafile or save metafile. 2. Use savePlot after producing your plot. See ?savePlot 3. Use win.metafile(...); plot(...); dev.off() On Sat, Dec 19, 2009 at 1:28 PM, Wenjie Lee <wenjieleemaillist at gmail.com> wrote:> Hi R Users, > > I'm using following sample code to save png plots. > > png(file="sample.png", width=8, height=6) > > Then I copy or use "insert pictures" function to get the image into MS Word. > After copying, if I try to stretch or re-size the image it starts getting > distorted. Is there a way to standardized graph pixels so that the > sharpness of the graph is maintained (at least for minor > stretching/re-sizing). Is it possible to achieve this? > > I know I can change width and height, but I have to submit this .doc file to > my adviser and he may need to re-size it. > > Any suggestion would be highly appreciated, > > Thanks, > Wenjie > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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. >