0

I plotted a map in R but when I export it the size is very small. How can I enlarge the map and still save it as a picture? (I know that I can save it as PDF and then it's a vector graphic - but I need to copy it to Power Point and also need a transparent background - I don't think that is possible with a PDF isn't it?)

As you can see here the map is way to small to use it in a Power Point slide: Map in PNG.format

If someone knows a good way to save it as vector graph that I can easily use in Power Point that would be perfect as well.

Stedy
  • 7,359
  • 14
  • 57
  • 77
SWR
  • 507
  • 1
  • 8
  • 17
  • you can zoom-in the pdf and take screenshot, if thats an option. – Nishanth Apr 22 '13 at 16:34
  • @e4e5f4 The problem is that in that case it is not transparent anymore – SWR Apr 22 '13 at 16:36
  • See [here](http://stackoverflow.com/q/7455046/324364) or simply look at the documentation for `pdf`. There is an argument called `bg`. – joran Apr 22 '13 at 16:37
  • @joran My plot in R is transaprent (I managed to do that) but when I safe it as a PDF and take a screenshot - it's with a white background again. But thx for your help. – SWR Apr 22 '13 at 16:59
  • Why would you ever expect the screenshot to retain the transparent background? It's an entirely different file format. – joran Apr 22 '13 at 17:02
  • Sure. I mentioned it because the first comment suggested to take a screenshot. – SWR Apr 22 '13 at 17:09
  • Additionally, since you don't have any axes, you can also get rid of the margin around your plot (with `par(mar=rep(0,4))` before the call to plot but after the call to `pdf(...)`) to maximize the amount of space occupied by your map in your pdf (I'm mentionning it because the picture you're showing has a lot of white space). – plannapus Apr 23 '13 at 06:56

1 Answers1

4

The png() function lets you specify width and height size in the default resolution of "px" and the defaults are 480 and 480. You can also supply a res argument in units of "ppi". If you have text you probably ought to specify point size >= 20 for legibility. I generally save my graphs as PDF and convert to PNG with an external program. However, the latest versions of PowerPoint will accept pdf formats. It is also possible to save as an .eps format.

IRTFM
  • 258,963
  • 21
  • 364
  • 487