Re: [R] png and pdf : point size, font size, etc.

From: Michael <wuolong_at_gmail.com>
Date: Wed, 27 Feb 2008 09:48:57 -0600

On 27 Feb 2008, Stephan Ripke wrote:

> The problem is, that the font size and the point-size of the plotpoints
> and the all of the plot is getting much smaller when using png-format. Why
> is this and how can I circumvent this issue? These are the two devices, I
> am opening for the two reasons:
>
> 1)
> pdf("name_out.pdf",11,3.5)
> 2)
> bitmap("name_out.png",height=3.5,width=11)

Why not the 'png' device?

You can try different picture size and font sizes. For png, the size of the figure is in pixels (rather than inches for pdf), and the fonts are in 'points'. The documentation of png says that one point is approximately one pixel.

However, that is assuming 72 dpi (screen resolution). For printing (e.g., inserting into Word), you would want at least 600dpi, or even 1200dpi, so you need set a font size proportional to the total image size.

I usually just make a pdf file and then convert it to png with 'convert' from ImageMagick to the desired resolution:

convert -density 600x600 a.pdf a.png

Michael



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. Received on Wed 27 Feb 2008 - 16:05:32 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 27 Feb 2008 - 16:30:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive