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

Default axis spacing parameters #112

Open
harrelfe opened this issue Jan 28, 2024 · 1 comment
Open

Default axis spacing parameters #112

harrelfe opened this issue Jan 28, 2024 · 1 comment

Comments

@harrelfe
Copy link

I have spent 20 years trying to get par(lgp=) and other parameters to work for all base plot layouts (creating functions of mfrow etc) but have never found a solution as perfect as the defaults used by ggplot2. plot2 at present is wasting space for tick mark label placement and axis label placement. If you can solve that in plot2 I'm much more likely to use it. Thanks!

@grantmcdermott
Copy link
Owner

Thanks Frank. I'll just repeat parts of our BlueSky discussion for tracking here:

A design principle of this package is that the corners of the plot region should remain fixed, i.e. consistent with the mar margins. This reduces surprises when users switch from vanilla plot and also makes it easy to integrate facets in a principled way that limits spacing headaches done the line. ("Easier" being a slight misnomer as it actually requires quite a lot of work internally to make this work. But from the user perspective everything should work seamlessly.)

The upshot is that user-supplied margin settings—say, par(mar = c(2.5, 2.5, 2.5, 0)+.1, mgp = c(1.5, .5, 0), tck = -0.02)—that reduce whitespace and look good for a single plot, should also look good for faceted plots (and plots with an automatic legend, for that matter).

But you certainly raise a good point about improving the defaults, without requiring that users spend time fiddling with these (obscure) parameters. Simultaneously, I've been thinking about providing a themes function that would automatically do this with good defaults that integrate well with the rest of the package. I'll create a separate issue for this themes issue and link back to this one.

Thanks for the suggestion!

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

No branches or pull requests

2 participants