Skip to content

Axis stuff#468

Merged
ldecicco-USGS merged 13 commits into
USGS-R:masterfrom
ldecicco-USGS:axis_stuff
Mar 28, 2017
Merged

Axis stuff#468
ldecicco-USGS merged 13 commits into
USGS-R:masterfrom
ldecicco-USGS:axis_stuff

Conversation

@ldecicco-USGS
Copy link
Copy Markdown
Member

No description provided.

# expect_true(all.equal(labels[12], as.Date("2013-12-15"), tolerance=0.01))
second.axis <- gs$side.1
which.axis <- which(names(second.axis)== 'axis')
labels <- lazyeval::lazy_eval(gs$side.1[[which.axis[2]]]$at, data=list(object=gs))
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jiwalker-usgs I had to add this calculation (which.axis) because the order got jiggered around. It doesn't seem like that would affect your code...but please double check that things are working.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this should be fine, I just made a brittle test.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Phew 😓

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.2%) to 80.517% when pulling 102876a on ldecicco-USGS:axis_stuff into f3fdd8b on USGS-R:master.

@lindsayplatt
Copy link
Copy Markdown

Fixing #453. The following examples work with this PR:

# this should give a warning - you can't use "log" inside an axis call
gsplot() %>%
     points(1:100, 1:100, log="xy", side=c(3,4)) %>%
     axis(side=c(1), log="") 
Warning message:
In axis(side = side, at = at, labels = labels, ...) :
  "log" is not a graphical parameter

# this is how you would have side 3 and 4 logged, but not 1
gsplot() %>%
    points(1:100, 1:100, log="xy", side=c(3,4)) %>%
    view(side=c(1,2), log='') %>% 
    axis(side=1) 

# this should log sides 3 & 4, but not 1 & 2
gsplot() %>%
    points(1:100, 1:100, log="xy", side=c(3,4)) %>%
    points(1:10,1:10, log="", side=c(1,2))

This is somewhat a continuation of #414.

# this has sides 1,2 not logged and side 4 logged (no side 3)
gs <- gsplot() %>% 
    points(1:2,c(2,25)) %>% 
    points(c(1,2), c(1, 1000000000), side=4, log='y') 
gs

Copy link
Copy Markdown

@lindsayplatt lindsayplatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some examples of what was causing issues and how they should look as a comment for future reference. This looks good to me!

@ldecicco-USGS ldecicco-USGS merged commit bab2061 into USGS-R:master Mar 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants