Skip to content

gtable axis names #1813

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

Closed
schloerke opened this issue Oct 3, 2016 · 4 comments
Closed

gtable axis names #1813

schloerke opened this issue Oct 3, 2016 · 4 comments

Comments

@schloerke
Copy link
Contributor

Hi,

I heavily depend upon the names of the gtable objects for GGally. With the current master branch of ggplot2, I am getting strange axis gtable names.

qplot(1:10, 21:30, geom = "point") %>% ggplot_build() %>% ggplot_gtable()
# TableGrob (10 x 7) "layout": 17 grobs
#     z         cells       name                                    grob
#1   0 ( 1-10, 1- 7) background        rect[plot.background..rect.4769]
#2   5 ( 5- 5, 3- 3)     spacer                          zeroGrob[NULL]
#3   7 ( 6- 6, 3- 3)     axis-t    absoluteGrob[GRID.absoluteGrob.4764]
#4   3 ( 7- 7, 3- 3)     spacer                          zeroGrob[NULL]
#5   6 ( 5- 5, 4- 4)     axis-l                          zeroGrob[NULL]
#6   1 ( 6- 6, 4- 4)      panel               gTree[panel-1.gTree.4744]
#7   9 ( 7- 7, 4- 4)     axis-r    absoluteGrob[GRID.absoluteGrob.4757]
#8   4 ( 5- 5, 5- 5)     spacer                          zeroGrob[NULL]
#9   8 ( 6- 6, 5- 5)     axis-b                          zeroGrob[NULL]
#10  2 ( 7- 7, 5- 5)     spacer                          zeroGrob[NULL]
#11 10 ( 4- 4, 4- 4)     xlab-t                          zeroGrob[NULL]
#12 11 ( 8- 8, 4- 4)     xlab-b titleGrob[axis.title.x..titleGrob.4747]
#13 12 ( 6- 6, 2- 2)     ylab-l titleGrob[axis.title.y..titleGrob.4750]
#14 13 ( 6- 6, 6- 6)     ylab-r                          zeroGrob[NULL]
#15 14 ( 3- 3, 4- 4)   subtitle  zeroGrob[plot.subtitle..zeroGrob.4766]
#16 15 ( 2- 2, 4- 4)      title     zeroGrob[plot.title..zeroGrob.4765]
#17 16 ( 9- 9, 4- 4)    caption   zeroGrob[plot.caption..zeroGrob.4767]

screen shot 2016-10-03 at 4 18 11 pm

axis-l is being called axis-t. axis-b is being called axis-r.

If these could be switched back, that'd be great.

Thank you!

  • Barret
@thomasp85
Copy link
Member

The layout and facet ting has been changed and along with that has come support for freely positioning of axis on either side. Because of this there is now axis-l, -r, -t, and -b, though some of them might be zeroGrobs depending on the plot settings. axis-l is still axis-l as before...

@schloerke
Copy link
Contributor Author

I like the update, but axis-l is a zeroGrob when it shouldn't be in the example above. And axis-t is a non-zeroGrob when it shouldn't be.

@thomasp85
Copy link
Member

Oh - thanks for that catch. That is me failing to convert a matrix to a vector in my head... Will be fixed!

Thanks

@schloerke
Copy link
Contributor Author

thank you!

@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants