Skip to content

Should framed themes also suppress inner facet axes? #674

Description

@grantmcdermott

EDIT: dropped the ggplot-specific angle and rather focus on framed themes in general.

Follow-up to #673.

Our new facet.axes = "outer" logic extends to non-framed themes (e.g., "clean2") out of the gate, as well as some "semi-framed" themes like "classic" and "socviz" (which have L-shaped frames). This essentially follows the same pattern/logic that we have had for ages: namely that faceted plots suppress their inner axes if they are drawn without a plot frame (box). If the same plot is drawn with a theme that uses a plot frame (e.g., "clean"), then we don't suppress the inner axes.

However, our new facet.axes = "outer" machinery makes it easier to extend axes suppression to frame plots too. As a result, I'm tempted to implement this same facet.axes = "outer" logic to framed themes like "clean" & co. Note that this would be a breaking aesthetic change from existing behaviour.

To illustrate, compare the "clean2" (no frame) and "clean" (framed) in this example:

library(tinyplot)
plt(mpg ~ wt, mtcars, facet = ~am:vs, theme = "clean2")

plt(mpg ~ wt, mtcars, facet = ~am:vs, theme = "clean")

Again, our new facet.axes machinery makes it easy to override this behaviour:

plt(mpg ~ wt, mtcars, facet = ~am:vs, theme = list("clean", facet.axes = "outer"))

The question is: should this be the default for framed themes too?

P.S. Another example, comparing the behaviour of our ggplot2-insired "linedraw" theme against the original:
To illustrate, consider this "linedraw" example:

library(ggplot2)
ggplot(mtcars, aes(wt, mpg)) +
  geom_point() +
  facet_wrap(vars(am, vs), labeller = labeller(.multi_line = FALSE)) +
  theme_linedraw()

As you can see, ggplot2 suppresses the inner axes for the top-right and bottom-right facets.

In contrast, we show all axes by default.

plt(mpg ~ wt, mtcars, facet = ~am:vs, theme = "linedraw")

Versus the override version (which should be the default)?

plt(mpg ~ wt, mtcars, facet = ~am:vs, theme = list("linedraw", facet.axes = "outer"))

Would appreciate others thoughts. (cc @vincentarelbundock @zeileis @strengejacke)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions