Saving a graph

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Saving a graph

Gang Chen-4
I read somewhere that vector graphics such as eps or dpf are more favorable
than alternatives (jpeg, bmp or png) for publication because vector graphics
scale properly when enlarged. However, my problem is that the file generated
from a graph of fixed size is too large (in the order of 10MB) because of
many data points in multiple scatterplots. Any suggestions?

Thanks,
Gang

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Saving a graph

Dieter Menne
Gang Chen-4 wrote
However, my problem is that the file generated
from a graph of fixed size is too large (in the order of 10MB) because of
many data points in multiple scatterplots. Any suggestions?
Generate pdf, open and save it in Adobe Acrobat which does a compression when the setting are correct.

Dieter
 
Reply | Threaded
Open this post in threaded view
|

Re: Saving a graph

Brian Ripley
On Mon, 29 Aug 2011, Dieter Menne wrote:

>
> Gang Chen-4 wrote:
>>
>> However, my problem is that the file generated
>> from a graph of fixed size is too large (in the order of 10MB) because of
>> many data points in multiple scatterplots. Any suggestions?
>>
>
> Generate pdf, open and save it in Adobe Acrobat which does a compression
> when the setting are correct.

*If* compression is enough, pdf() in R-devel does it, as does
cairo_pdf() in current R.  And there are other ways than Acrobat to
compress/compact a PDF file: see ?tools::compactPDF  and the 'Writing
R Extensions' manual.

However, compression will not make that much of a difference (maybe a
factor of 3), and the real problem seems to be the inappropriate plot.
If you really need a plot with hundreds of thousands of points (or
more), use a format like PNG -- but there are better ways to display
such plots for most statistical purposes.  E.g. image and contour
plots of densities, hexplots, density-dependent thinning ....

--
Brian D. Ripley,                  [hidden email]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Saving a graph

jannis-2
In reply to this post by Dieter Menne
Chang Cheng,


this question has been asked on this list for several times. I would suggest you search the list archive (http://r.789695.n4.nabble.com/R-help-f789696.html or www.rseek.com) prior to posting in the future. "graph size many points pdf" would give you at least 10 threads with detailed description. There are numerous solutions and most of them point into Dieters or Brian Ripleys directions.


Jannis

--- Dieter Menne <[hidden email]> schrieb am Di, 30.8.2011:

> Von: Dieter Menne <[hidden email]>
> Betreff: Re: [R] Saving a graph
> An: [hidden email]
> Datum: Dienstag, 30. August, 2011 05:57 Uhr
>
> Gang Chen-4 wrote:
> >
> > However, my problem is that the file generated
> > from a graph of fixed size is too large (in the order
> of 10MB) because of
> > many data points in multiple scatterplots. Any
> suggestions?
> >
>
> Generate pdf, open and save it in Adobe Acrobat which does
> a compression
> when the setting are correct.
>
> Dieter
>  
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Saving-a-graph-tp3777456p3778015.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email]
> 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.
>

______________________________________________
[hidden email] 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.