[R] How to vectorize plot graphic?

Carl Witthoft carl at witthoft.com
Sun Dec 1 16:39:10 CET 2013


Off the top of my head,  I'd suggest trying ggsave()  with the extension
".svg" .  I realize that SVG files are not recognized by some image display
apps (Microsoft Windows I'm looking at YOU), but IMHO it's the best choice 
for vectorized images.


Alexander Shenkin wrote
> Hi Folks,
> 
> Using ggplot, I've produced the following graphic:
> http://i.imgur.com/39a139C.png
> 
> The graphics in the plot seem to be bitmapped and not vectorized.  That
> is, the vertical and horizontal lines jump rows of pixels instead of
> having just nice, angled lines.  Any thoughts about how to get these
> graphics vectorized?  Or am I misunderstanding something?
> 
> Another example:
> 
> The code:
> 
>     require(ggplot2)
>     df = data.frame(x = c(1:360), y = sin(seq(0,2*pi*3,length.out = 360)))
>     ggplot(df, aes(x=x, y=y)) + geom_line()
> 
> produces http://i.imgur.com/mjjSKih.png
> 
> Perhaps what I'm dealing with here is my screen resolution.  However, I
> use ggsave() to save .wmf files, and those also turn out to be bitmaps
> and not vectors.
> 
> Thanks,
> Allie
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________

> R-help@

>  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.





--
View this message in context: http://r.789695.n4.nabble.com/How-to-vectorize-plot-graphic-tp4681424p4681427.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list