Re: [R] Why the variation when creating .pdf file output for my plots?

From: Jonathan Christensen <dzhonatan_at_gmail.com>
Date: Wed, 30 Jun 2010 14:15:20 -0600

Karl,

dev2bitmap runs its output through Ghostscript, and I assume that the difference is somehow due to that. I can't say whether Ghostscript is decreasing the file quality or just doing something clever, though.

Jonathan

On Wed, Jun 30, 2010 at 10:30 AM, Karl Brand <k.brand_at_erasmusmc.nl> wrote:

> Thank you Erik!
>
> That works nicely now. The file size in (in kilobytes) is equal to the
> "File>Save As>PDF" method.
>
> Still curious why the file sizes (in Kb), differ by a factor of ~2 between
> the two methods:
>
> pdf()
> dev2bitmap(method = "pdf")
>
> I'm just *assuming* here that file size is inidcative of image quality. Is
> this assumption correct? If so, how would one increase .pdf quality within
> the dev2bitmap() function?
>
> With thanks for any further thoughts on this, cheers,
>
> Karl
>
>
>
>
> On 6/30/2010 4:58 PM, Erik Iverson wrote:
>
>>
>>
>>> Method 3:
>>> > pdf(file="my_plot.pdf", paper="a4")
>>> > dev.off()
>>>
>>
>> The `pdf` function opens a *new* graphics device, you then send output
>> to the device before calling dev.off(), e.g.,
>>
>> pdf(file = my_plot.pdf")
>> plot(1:10, 1:10)
>> dev.off()
>>
>>
>>
>>> -yields a .pdf file of 1kb (same plot example) and returns the
>>> following error when attempting to open with Adobe acrobat:
>>>
>>> "There was an error opening this document. This file cannot be opened
>>> because it has no pages."
>>>
>>
> --
> Karl Brand <k.brand_at_erasmusmc.nl>
> Department of Genetics
> Erasmus MC
> Dr Molewaterplein 50
> 3015 GE Rotterdam
> P +31 (0)10 704 3409 | F +31 (0)10 704 4743 | M +31 (0)642 777 268
>
> ______________________________________________
> 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.
>

        [[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. Received on Wed 30 Jun 2010 - 20:19:08 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 30 Jun 2010 - 20:20:44 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