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

Are strips and panel grids 'guides'? #5169

Closed
teunbrand opened this issue Jan 31, 2023 · 2 comments
Closed

Are strips and panel grids 'guides'? #5169

teunbrand opened this issue Jan 31, 2023 · 2 comments

Comments

@teunbrand
Copy link
Collaborator

I'm aware that they currently aren't part of any user-facing guide system. This issue is to explore thought on whether they should be (after guides are ported to ggproto).

Arguably, one might see the panel grid as a guide for the panel. There is even a guide_grid() function that coord_cartesian() and coord_trans() uses to draw the panel grid. I think it might be useful to make the panel grid a formal, extensible guide. Here are some examples for which that might be useful:

  • Draw major grid lines in between breaks (instead of at breaks) of discrete scales to better visually separate the groups.
  • Draw zebra (alternating dark/light) stripes along a date/time scale to indicate e.g. decades.
  • Draw the minor grid lines for log scales like logarithmic graph paper.

Likewise, the strips can be seen as a guide for facets. Facets do a lot of things, ranging from the layout of panels to initiating scales, labelling and drawing strips to assembling the plot's gtable, etc. I think if we make the strips a guide, we can offload some of the facet's complexity onto the strip guide. Moreover, I think they might be a neat extension point, as you wouldn't have to rewrite the complicated methods of facets to draw a new type of strip. I've taken a similar approach here for your perusal of the concept.

@teunbrand
Copy link
Collaborator Author

I made a small proof-of-concept for panel grids as guides here.

@teunbrand
Copy link
Collaborator Author

Closing this as it probably doesn't make a lot of sense to implement this in vanilla ggplot2

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

1 participant