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

minor ticks aren't inheriting pars #437

Closed
ldecicco-USGS opened this issue Feb 14, 2017 · 13 comments
Closed

minor ticks aren't inheriting pars #437

ldecicco-USGS opened this issue Feb 14, 2017 · 13 comments
Assignees
Labels
Milestone

Comments

@ldecicco-USGS
Copy link
Member

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)

Should have the minor tick marks going outside, shows up inside:

image

@ldecicco-USGS
Copy link
Member Author

Also:

gs <- gsplot() %>%
  points(1:100, 1:100, log="xy") %>%
  axis(side=c(3,4), labels=FALSE, n.minor=4) %>%
  axis(side=c(1,2), n.minor=4)
gs

side's 3 and 4 ticks aren't logged (and should be).

@ldecicco-USGS ldecicco-USGS self-assigned this Feb 14, 2017
@lindsayplatt
Copy link

☝️ @ldecicco-USGS I'm assuming this is example is something to do with #436 ?

@ldecicco-USGS
Copy link
Member Author

They might be related, but that issue is specific to the date_axis.

@ldecicco-USGS
Copy link
Member Author

Actually, that second example I posted has nothing to do with minor ticks. This:

gsplot() %>%
   points(1:100, 1:100, log="xy") %>%
   axis(side=c(3,4)) 

Shows a linear axis on 3 and 4 (and log on 1, 2). I would expect 3 and 4 to be logged if no other call to 3 & 4 are defined.

@lindsayplatt
Copy link

Yeah, that second example seems like a second issue.

@ldecicco-USGS
Copy link
Member Author

Yup, making a new issue.

@lindsayplatt
Copy link

I'm seeing logged ticks now, but still seeing minor ticks on the inside instead of outside:

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)

image

gs <- gsplot() %>%
    points(1:100, 1:100, log="xy") %>%
    axis(side=c(3,4), n.minor=4) %>%
    axis(side=c(1,2), n.minor=4)
gs

image

@lindsayplatt lindsayplatt added this to the 0.8.0 milestone Mar 20, 2017
@lindsayplatt
Copy link

#436 seems to duplicate the remaining bug here. @ldecicco-USGS @jiwalker-usgs please verify this.

@lindsayplatt
Copy link

Wait, I did this earlier in this thread.... @ldecicco-USGS concluded that they were not the same. Sorry.

@lindsayplatt
Copy link

@ldecicco-USGS we have an arg called tcl.minor. That fixes the issue, but @jiwalker-usgs is thinking we should have the default match the tcl and tcl.minor needs to be used if you want them to be different. Either way, we need more documentation about this.

gsplot() %>%
    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, tcl.minor=-0.2)

image

@lindsayplatt
Copy link

Default tcl.minor = par('tcl')*0.5 so that it gets the correct direction. Add documentation about tcl.minor.

@jordansread
Copy link
Member

Thought this would be relatively simple. issues I see here:

  1. tcl gets ignored in axis already, which is 👎
points(gsplot(), 1, 0, tcl = -0.5) %>% axis(side=1)
#differs from 
points(gsplot(), 1, 0) %>% axis(side=1, tcl = 0.5)
  1. axis is a call for multiple sides, so getting a default from a side par would need to be side-specific
  2. There is a hierarch of getting the default for tcl.minor that goes like this (I may be missing one?):
  • from the input of tcl on the axis call (but note this one is broken as is)
  • from the side par value of tcl if it exists
  • from the global par value of tcl in the gsplot object if it exists
  • lastly, from the par('tcl') value if none of the others are present.

jordansread pushed a commit to jordansread/gsplot that referenced this issue Mar 22, 2017
@jordansread
Copy link
Member

closed with #460

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

No branches or pull requests

3 participants