Closed briandk closed 13 years ago
-Wil
William Doane http://DrDoane.com
On 2011 Sep 01, at 00:03, briandk wrote:
@rmpruzek's PDFs for granovagg.1w look different than mine do.
Reply to this email directly or view it on GitHub: https://github.com/briandk/granovaGG/issues/109
I'm going to try some tests on my linux box.
Here's the test code I'd like people to try. If possible, email me your results for testplot1.pdf and testplot2.pdf
So that everyone can see at least one other version, here are my 2 plots:
http://DrDoane.com/screenshots/testplot1-20110901-001528.pdf
http://DrDoane.com/screenshots/testplot2-doane-20110901-001642.pdf
-Wil
William Doane http://DrDoane.com
On 2011 Sep 01, at 00:13, briandk wrote:
Here's the test code I'd like people to try. If possible, email me your results for testplot1.pdf and testplot2.pdf
https://gist.github.com/1185420
Reply to this email directly or view it on GitHub: https://github.com/briandk/granovaGG/issues/109#issuecomment-1964751
Wil, I see no difference in yours other than jittering (as in my case). b
From: WilDoane reply@reply.github.com To: rmpruzek@yahoo.com Sent: Thursday, September 1, 2011 12:17 AM Subject: Re: [granovaGG] PDF outputs appear different on different systems (#109)
So that everyone can see at least one other version, here are my 2 plots:
http://DrDoane.com/screenshots/testplot1-20110901-001528.pdf
http://DrDoane.com/screenshots/testplot2-doane-20110901-001642.pdf
-Wil
William Doane http://DrDoane.com
On 2011 Sep 01, at 00:13, briandk wrote:
Here's the test code I'd like people to try. If possible, email me your results for testplot1.pdf and testplot2.pdf
https://gist.github.com/1185420
Reply to this email directly or view it on GitHub: https://github.com/briandk/granovaGG/issues/109#issuecomment-1964751
Reply to this email directly or view it on GitHub: https://github.com/briandk/granovaGG/issues/109#issuecomment-1964779
W, B, I'm using R ver. 2.13.0, ggplot2 0.8.9, and default R fonts (?). I'm running OS 10.6.8 (not yet Lion), and I've never changed defaults for Fonts or Quartz (AKAICR). b
From: WilDoane reply@reply.github.com To: rmpruzek@yahoo.com Sent: Thursday, September 1, 2011 12:08 AM Subject: Re: [granovaGG] PDF outputs appear different on different systems (#109)
-Wil
William Doane http://DrDoane.com
On 2011 Sep 01, at 00:03, briandk wrote:
@rmpruzek's PDFs for granovagg.1w look different than mine do.
Reply to this email directly or view it on GitHub: https://github.com/briandk/granovaGG/issues/109
Reply to this email directly or view it on GitHub: https://github.com/briandk/granovaGG/issues/109#issuecomment-1964730
You're correct, Bob... there is no significant difference in my 2 graphics.
The problem seems to be that ggplot2 is sensitive to the window size at the time of rendering to a file. Brian and I are doing some tests right now with different window sizes and it's showing pronounced differences. More details as we get some samples.
-Wil
William Doane http://DrDoane.com
On 2011 Sep 01, at 00:41, rmpruzek wrote:
Wil, I see no difference in yours other than jittering (as in my case). b
From: WilDoane reply@reply.github.com To: rmpruzek@yahoo.com Sent: Thursday, September 1, 2011 12:17 AM Subject: Re: [granovaGG] PDF outputs appear different on different systems (#109)
So that everyone can see at least one other version, here are my 2 plots:
http://DrDoane.com/screenshots/testplot1-20110901-001528.pdf
http://DrDoane.com/screenshots/testplot2-doane-20110901-001642.pdf
-Wil
William Doane http://DrDoane.com
On 2011 Sep 01, at 00:13, briandk wrote:
Here's the test code I'd like people to try. If possible, email me your results for testplot1.pdf and testplot2.pdf
https://gist.github.com/1185420
Reply to this email directly or view it on GitHub: https://github.com/briandk/granovaGG/issues/109#issuecomment-1964751
Reply to this email directly or view it on GitHub: https://github.com/briandk/granovaGG/issues/109#issuecomment-1964779
Reply to this email directly or view it on GitHub: https://github.com/briandk/granovaGG/issues/109#issuecomment-1964884
Brian, I've done it, both ggsave and pdf for testplt1 and testplt2. The same ... so it seems. b (But not what I got before (which seemed like a zoom out from this).) b ps. I'm calling it a night. Thanks for your work.
From: briandk reply@reply.github.com To: rmpruzek@yahoo.com Sent: Thursday, September 1, 2011 12:13 AM Subject: Re: [granovaGG] PDF outputs appear different on different systems (#109)
Here's the test code I'd like people to try. If possible, email me your results for testplot1.pdf and testplot2.pdf
https://gist.github.com/1185420
Reply to this email directly or view it on GitHub: https://github.com/briandk/granovaGG/issues/109#issuecomment-1964751
@rmpruzek - Wil and I figured out that it's a subtle issue related to R graphics. In short, any of R's default graphical outputs (pdf()
and jpeg()
, for example) accept height
and width
arguments. The values for height and width matter for the output.
It also turns out that when you call ggsave()
without explicitly providing height
and width
arguments, it assumes the height and width you want are the height and width of your R graphics window. Since you (I believe) have a much larger monitor than Wil and I do, your ggsave() calls are using larger dimensions by default.
With the code demonstration below, I can conclusively prove three things:
width
and height
arguments to ggsave()
, pdf()
, and other graphics device calls.The entire source code I used is included via a link at the bottom of this post. For now, let me lead you through:
I made a folder called testplots
on my desktop BEFORE running the R code.
# Making sure you have a fresh copy of granovaGG
remove.packages("granovaGG", lib = .libPaths())
library(devtools)
install_github(repo = "granovaGG", username = "briandk", branch = "dev")
library(granovaGG)
library(granova)
setwd("~/Desktop/testplots") # I created the testplots directory in advance
granovagg.1w(data = mpg$hwy, group = mpg$manufacturer)
ggsave("testplot1.pdf", width = 7, height = 7)
# Checking what your default quartz graphics dimensions are
par("din")
# Creating a test plot assuming a huge monitor
ggsave("testplot2.pdf", width = 15, height = 15)
The output looks like this, with testplot1.pdf
on the left and testplot2.pdf
on the right:
# proving that the same effects happen to classic granova plots
pdf("testplot3.pdf", width = 7, height = 7)
granova.1w(data = mpg$hwy, group = mpg$manufacturer)
dev.off()
pdf("testplot4.pdf", width = 15, height = 15)
granova.1w(data = mpg$hwy, group = mpg$manufacturer)
dev.off()
Is available here: https://gist.github.com/1185420
Brian, This is informative, and appears to resolve the key issues. Nice to have it. Again, you (w/ Wil) have shown what I like most to see in students and colleagues: growth and developed skill that solves problems! Because this post is really quite important in my view, I'd like to see it posted (where?) on github, and sent to the team. Best, bob
From: briandk reply@reply.github.com To: rmpruzek@yahoo.com Sent: Thursday, September 1, 2011 2:18 AM Subject: Re: [granovaGG] PDF outputs appear different on different systems (#109)
@rmpruzek - Wil and I figured out that it's a subtle issue related to R graphics. In short, any of R's default graphical outputs (pdf()
and jpeg()
, for example) accept height
and width
arguments. The values for height and width matter for the output.
It also turns out that when you call ggsave()
without explicitly providing height
and width
arguments, it assumes the height and width you want are the height and width of your R graphics window. Since you (I believe) have a much larger monitor than Wil and I do, your ggsave() calls are using larger dimensions by default.
With the code demonstration below, I can conclusively prove three things:
width
and height
arguments to ggsave()
and pdf()
calls.The entire source code I used is included via a link at the bottom of this post. For now, let me lead you through:
I made a folder called testplots
on my desktop BEFORE running the R code.
# Making sure you have a fresh copy of granovaGG
remove.packages("granovaGG", lib = .libPaths())
library(devtools)
install_github(repo = "granovaGG", username = "briandk", branch = "dev")
library(granovaGG)
library(granova)
setwd("~/Desktop/testplots") # I created the testplots directory in advance
granovagg.1w(data = mpg$hwy, group = mpg$manufacturer)
ggsave("testplot1.pdf", width = 7, height = 7)
# Checking what your default quartz graphics dimensions are
par("din")
# Creating a test plot assuming a huge monitor
ggsave("testplot2.pdf", width = 15, height = 15)
The output looks like this, with testplot1.pdf
on the left and testplot2.pdf
on the right:
# proving that the same effects happen to classic granova plots
pdf("testplot3.pdf", width = 7, height = 7)
granova.1w(data = mpg$hwy, group = mpg$manufacturer)
dev.off()
pdf("testplot4.pdf", width = 15, height = 15)
granova.1w(data = mpg$hwy, group = mpg$manufacturer)
dev.off()
Is available here: https://gist.github.com/1185420
Reply to this email directly or view it on GitHub: https://github.com/briandk/granovaGG/issues/109#issuecomment-1965312
In light of my discussion and @rmpruzek's comments, I'm closing this issue.
@rmpruzek's PDFs for granovagg.1w look different than mine do.