An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20131201/da941206/attachment.pl>
How to vectorize plot graphic?
5 messages · Carl Witthoft, Jeff Newmiller, Alexander Shenkin
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.
You have mentioned nothing about the device you are writing the plot to. If to the default and you are copying it from there as a bitmap, then what you are describing sounds as expected. Read the R Input/Output manual (again) for other output options.
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
Alexander Shenkin <ashenkin at ufl.edu> 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 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.
Thanks Carl. Yeah, I can get vectorized graphics out via
ggsave("temp.pdf") too. But I need to add the graphic to a word doc on
windows. Hence the desire to use wmf, which should induce a vector
format (shouldn't it?).
On 12/1/2013 10:39 AM, Carl Witthoft wrote:
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.
______________________________________________ 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.
Thanks Jeff. I'm not sure to which manual you are referring. Nothing like what you mention is found here: http://cran.r-project.org/manuals.html . Perhaps you're referring to The Data Import/Export Manual, but that wouldn't make sense. Googling "R Input/Output manual" doesn't help. Regarding the device, I'm in R-Studio, plotting to the standard device there (I suppose). In any case, I'm not totally sure what the interface between R-Studio's plot window and the R instance is. I think that, as you say, what I'm getting is as expected. I zoom and the plot zooms as expected. So, I guess that part is solved. However, the writing to .wmf as a bitmap instead of a vector is still a mystery to me. Thanks, Allie
On 12/1/2013 12:29 PM, Jeff Newmiller wrote:
You have mentioned nothing about the device you are writing the plot to. If to the default and you are copying it from there as a bitmap, then what you are describing sounds as expected. Read the R Input/Output manual (again) for other output options.
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
Alexander Shenkin <ashenkin at ufl.edu> 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 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.