-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config branch... #402
Config branch... #402
Conversation
Merge branch 'master' of github.com:USGS-R/gsplot into configBranch # Conflicts: # R/config.R # inst/doc/gsplotIntro.html
Merge branch 'master' of github.com:ldecicco-USGS/gsplot into configBranch # Conflicts: # inst/doc/gsplotIntro.html
@@ -1,4 +1,5 @@ | |||
gsconfig <- new.env(parent = emptyenv()) | |||
gsconfig$orignial.par <- par(no.readonly = TRUE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ldecicco-USGS "original"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HAHAHAHA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, learned how to wipe out a branch and this is what happens
@ldecicco-USGS I'm on your branch (and built/reloaded), but this is still causing an issue. It's like the way legend handles par is messing it up because it looks ok when I exclude g1 <- gsplot() %>%
lines(1:9, seq(1,3, by=0.25),
legend.name="second line") %>%
# formatting y axes
axis(side=2, at=1:10)
layout(matrix(1:2, 1, 2))
g1
g1 |
I did not test out my branch at all with I totally agree that I'm guessing what you are seeing there is something I've been concerned about for a little while now. Because we are changing |
It happens when you just print the plot twice in a row as well, layout was just easier to show them side by side |
It only changes par when draw_legend is called, which doesn't happen here because I never have the legend drawn. I only added legend.name, but never used legend(). So I think something else is at play here |
I'm just saying:
|
Here's how I'd start doing some troubleshooting for par things:
|
The difference between the 2 graphs in
|
Oh and having xpd be different would explain all of that. Adding this fixes the issue, so now I can figure out where that's being changed. g1 <- gsplot(xpd=FALSE) %>%
lines(1:9, seq(1,3, by=0.25),
legend.name="second line") %>%
# formatting y axes
axis(side=2, at=1:10)
layout(matrix(1:2, 1, 2))
g1
g1 |
par(xpd=TRUE) was in the wrong place
should we up to 0.7.1 when this merges?? |
Yeah |
I tested this with repgen and the only thing I noticed that was different was a legend was being cutoff. I'm trying to recreate a simple example. |
Something with this branch seems to be ignoring par(mar=c(5,4,10,2))
g1 <- gsplot() %>%
points(1:10, 1:10, pch=20, legend.name="first points") %>%
lines(4:1, 4:1, legend.name="first line") %>%
points(c(3,7,4), c(9,3,6), pch=20, col="black", legend.name="second points") %>%
legend(location="above")
g1 v0.7.0this branch |
I can fix that...maybe by the end of the day...silly mistake |
Oh ok cool! Think that might also fix #405 ?? |
Forgot about this...will try to do soon |
I was thinking we could take a look tomorrow at the sprint planning meeting as well |
@@ -70,14 +71,14 @@ add_to_view <- function(object, call.args, side, where){ | |||
#' gsplot:::filter_arguments('points', x=1:5, y=1:5, xlim=c(0,10), ylim=c(0,10), | |||
#' callouts(labels=c(rep(NA, 4), "oh")))$extracted.args | |||
#' @keywords internal | |||
filter_arguments <- function(fun.name, ...){ | |||
filter_arguments <- function(fun.name, ..., custom.config = FALSE){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was thinking that default would be custom.config = NULL
since that is what you would get if
custom.config = object[["global"]][["config"]][["config.file"]]
didn't exist. Maybe I missed it, but where do you test for !custom.config
or where is that used?
@ldecicco-USGS do you remember what we concluded about this? Is there more work to do? |
par issues: #254 pass config a list or a filename |
I'm just going to start over |
I had been using the dev.off to fix the bleeding par, but that had an unintended consequence when kniting. This PR instead goes back to the original scheme where we'd save the original par in the gsconfig, then reset all of those pars if someone changes the config (either with loadConfig or in the call to the gsplot object). This somewhat alters all the figures because now the background tends to be translucent instead of white. I actually think that's better, but would like to hear more discussion.