is there a way to reduce the size of pdf files in R: ? compression? lower dpi ? or some other option?
It would help if we knew how big your pdf is and why it is big. Can you show an example or at least describe the process used to generate the file and what you goals are in creating/displaying the file? -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Nevil Amos > Sent: Thursday, April 29, 2010 9:38 AM > To: r-help at r-project.org > Subject: [R] reduce size of pdf > > is there a way to reduce the size of pdf files in R: ? > compression? > > lower dpi ? > > or some other option? > > ______________________________________________ > 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.
Nevil Amos wrote:> is there a way to reduce the size of pdf files in R: ? > compression? > > lower dpi ? > > or some other option? > > ______________________________________________ > 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.What could also be an option is to export the graph to PNG. Using a large resolution gives very good results, certainly publication quality. cheers, Paul
The file is a large number of scatterplot matrices (120pp of 4x4 matrix) the individual plots may have up to several hudred points. I am already using the "useDingbats" but the files are still very large - I can reduce them about 50% in cute.pdf by changing the dpi setting but it would be good to handle directly in R They need to be screen/ draft print quality only not for publication. They are being used to ciruclate to a number of people for discussion On 30/04/2010 2:20 AM, Greg Snow wrote:> It would help if we knew how big your pdf is and why it is big. Can you show an example or at least describe the process used to generate the file and what you goals are in creating/displaying the file? > >
Dear Nevil, Converting your pdf to png will be the most efficient way to reduce the file size with scatter plots. You can either export directly to pdf or first create a pdf and then use ghostscript to convert it into png. I tend to the the latter because it is easier to get plots with a consistent layout. The convertion can be done within R. See the code below. system("C:/Progra~1/gs/gs8.64/bin/gswin32 -r300 -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -dGraphicsAlphaBits=4 -sOutputFile=fig_Power_Resid.png fig_Power_Resid.pdf") HTH, Thierry ------------------------------------------------------------------------ ---- ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek team Biometrie & Kwaliteitszorg Gaverstraat 4 9500 Geraardsbergen Belgium Research Institute for Nature and Forest team Biometrics & Quality Assurance Gaverstraat 4 9500 Geraardsbergen Belgium tel. + 32 54/436 185 Thierry.Onkelinx at inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey> -----Oorspronkelijk bericht----- > Van: r-help-bounces at r-project.org > [mailto:r-help-bounces at r-project.org] Namens Nevil Amos > Verzonden: vrijdag 30 april 2010 1:37 > Aan: Greg Snow > CC: r-help at r-project.org > Onderwerp: Re: [R] reduce size of pdf > > The file is a large number of scatterplot matrices (120pp of 4x4 > matrix) the individual plots may have up to several hudred points. > > I am already using the "useDingbats" but the files are still > very large > - I can reduce them about 50% in cute.pdf by changing the dpi > setting but it would be good to handle directly in R > > They need to be screen/ draft print quality only not for publication. > > They are being used to ciruclate to a number of people for discussion > > > > > On 30/04/2010 2:20 AM, Greg Snow wrote: > > It would help if we knew how big your pdf is and why it is > big. Can you show an example or at least describe the > process used to generate the file and what you goals are in > creating/displaying the file? > > > > > > ______________________________________________ > 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. >Druk dit bericht a.u.b. niet onnodig af. Please do not print this message unnecessarily. Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document. The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document.
or possibly use smoothScatter() to produce the scatter plots.... On Fri, Apr 30, 2010 at 12:06 PM, ONKELINX, Thierry <Thierry.ONKELINX at inbo.be> wrote:> Dear Nevil, > > Converting your pdf to png will be the most efficient way to reduce the > file size with scatter plots. > > You can either export directly to pdf or first create a pdf and then use > ghostscript to convert it into png. I tend to the the latter because it > is easier to get plots with a consistent layout. The convertion can be > done within R. See the code below. > > system("C:/Progra~1/gs/gs8.64/bin/gswin32 -r300 -dSAFER -dBATCH > -dNOPAUSE -sDEVICE=png16m -dGraphicsAlphaBits=4 > -sOutputFile=fig_Power_Resid.png fig_Power_Resid.pdf") > > HTH, > > Thierry > ------------------------------------------------------------------------ > ---- > ir. Thierry Onkelinx > Instituut voor natuur- en bosonderzoek > team Biometrie & Kwaliteitszorg > Gaverstraat 4 > 9500 Geraardsbergen > Belgium > > Research Institute for Nature and Forest > team Biometrics & Quality Assurance > Gaverstraat 4 > 9500 Geraardsbergen > Belgium > > tel. + 32 54/436 185 > Thierry.Onkelinx at inbo.be > www.inbo.be > > To call in the statistician after the experiment is done may be no more > than asking him to perform a post-mortem examination: he may be able to > say what the experiment died of. > ~ Sir Ronald Aylmer Fisher > > The plural of anecdote is not data. > ~ Roger Brinner > > The combination of some data and an aching desire for an answer does not > ensure that a reasonable answer can be extracted from a given body of > data. > ~ John Tukey > > >> -----Oorspronkelijk bericht----- >> Van: r-help-bounces at r-project.org >> [mailto:r-help-bounces at r-project.org] Namens Nevil Amos >> Verzonden: vrijdag 30 april 2010 1:37 >> Aan: Greg Snow >> CC: r-help at r-project.org >> Onderwerp: Re: [R] reduce size of pdf >> >> The file is a large number of scatterplot matrices (120pp of 4x4 >> matrix) ?the individual plots may have up to several hudred points. >> >> I am already using the "useDingbats" ?but the files are still >> very large >> - I can reduce them about 50% in cute.pdf by changing the dpi >> setting but it would be good to handle directly in R >> >> They need to be screen/ draft print quality only not for publication. >> >> They are being used to ciruclate to a number of people for discussion >> >> >> >> >> On 30/04/2010 2:20 AM, Greg Snow wrote: >> > It would help if we knew how big your pdf is and why it is >> big. ?Can you show an example or at least describe the >> process used to generate the file and what you goals are in >> creating/displaying the file? >> > >> > >> >> ______________________________________________ >> 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. >> > > Druk dit bericht a.u.b. niet onnodig af. > Please do not print this message unnecessarily. > > Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer > en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is > door een geldig ondertekend document. The views expressed in ?this message > and any annex are purely those of the writer and may not be regarded as stating > an official position of INBO, as long as the message is not confirmed by a duly > signed document. > > ______________________________________________ > 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. >
Possibly Parallel Threads
- removeing only rows/columns with "na" value from square ( symmetrical ) matrix.
- How to replace all <NA> values in a data.frame with another ( not 0) value
- How to remove $ (Dollar sign) from string
- replacing "+" in string
- How to plot CI's (llim ulim) on ecodist mgram