USGS-R / gsplot

plotting foundation for timeseries reporting
Other
6 stars 14 forks source link

Capture par arguments in axis call(s) #456

Closed jordansread closed 7 years ago

jordansread commented 7 years ago

related to #437 , but this issue covers the axis call ignoring the option.args given by the user that should influence the rendering of the axis. For example:

points(gsplot(), 1, 0) %>% axis(side=1, tcl = -0.5)

ignores the tcl argument

jordansread commented 7 years ago

I have gone back and forth on where these args should end up, and am suggesting that the are isolated w/ axis and don't bubble up into the side.1$par$tcl arg.

This is the expected behavior as I see it, but this is up for discussion.

lindsayplatt commented 7 years ago

@jread-usgs are you saying that including things like tcl in axis calls should not do anything? Or including tcl in points calls should not do anything? I agree with the latter, but the former is how base is set up:

plot(1,2)
axis(side=2, tcl=0.5)

image

lindsayplatt commented 7 years ago

Actually just noticed your comment in #437, https://github.com/USGS-R/gsplot/issues/437#issuecomment-288214676. So I agree with you. Arguments affecting axes should not be able to be called in points, lines, etc. It is strange that we have been straying from base behavior in that way. I think repgen will need to be updated if we change this behavior, but I think it is completely reasonable.

# base doesn't work
plot(1,2)
points(1,20000, log='y')
Warning message:
In plot.xy(xy.coords(x, y), type = type, ...) :
  "log" is not a graphical parameter

# gsplot does work
gsplot() %>% points(1,20000, log='y')
jordansread commented 7 years ago

for your first comment, no I wasn't saying that the tcl should be ignored when included in axis, I was saying that we need to keep it and we were mistakenly ignoring it.

Second comment: I disagree, you should be able to modify side properties within a points call and that should all work now (for example, you could put tcl in the points call and it will apply to both sides, but it could be overwritten by an axis call to one of those sides).

lindsayplatt commented 7 years ago

Wow, I interpreted all of that very incorrectly. So what is meant by "don't bubble up into the side.1$par$tcl" is really just about how the gsplot object appears in the end, not how you can actually specify tcl.

jordansread commented 7 years ago

yeah, my comment about bubbling up is confusing. I was only referring to the args when they are within axis() for that comment.

lindsayplatt commented 7 years ago

Closed by #459