Skip to content
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

Should grid get minor tick locations? #438

Open
ldecicco-USGS opened this issue Feb 14, 2017 · 4 comments
Open

Should grid get minor tick locations? #438

ldecicco-USGS opened this issue Feb 14, 2017 · 4 comments
Assignees

Comments

@ldecicco-USGS
Copy link
Member

ldecicco-USGS commented Feb 14, 2017

I think so. It's not obvious to me how.

gsplot(frame.plot=FALSE) %>%
    background_color(col="grey90") %>%
    grid(col = "white", lty = 1) %>%
    par(tcl=-0.2, cex=0.75, xaxs= "r", yaxs =  "r") %>%
    axis(side = c(1,2), lwd = 0, lwd.ticks = 1, n.minor=1)

@jiwalker-usgs maybe I can pick your brain to see if we can use some lazy_eval to get those locations.

@lindsayplatt
Copy link

it's not a base feature:

plot(1:10)
axis( 2, seq(1, 10, by=0.25), las = 1, tcl = .2, labels=FALSE )
grid(lwd = 2)

@jiwalker-usgs
Copy link
Contributor

One of the issues with base is that a lot of information is lost in the approach it takes to plotting. For example grid has very little information of the previous calls that have taken place as can be seen above. The information it does have is only that which can be represented in par. The question we have then is how much do we want to go beyond base because we can, or how much we want to stay consistent with the way things work in base.

Probably worth a discussion.

@ldecicco-USGS
Copy link
Member Author

Yeah, base grid is nearly useless...gsplot's is a lot better already. My vote is to have axis and grid act pretty similar:

gsplot() %>%
  axis(side = c(1,2), lwd = 0, lwd.ticks = 1, n.minor=1) %>%
  grid(n.minor=1)

@ldecicco-USGS
Copy link
Member Author

That lets the user decide if they want the grid lines only at the major ticks, or both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants