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

Center x-axis annotations by default #43

Closed
thibautjombart opened this issue Sep 3, 2020 · 1 comment
Closed

Center x-axis annotations by default #43

thibautjombart opened this issue Sep 3, 2020 · 1 comment
Labels
FR / enhancement New feature or request

Comments

@thibautjombart
Copy link
Contributor

The current default for x-axis annotations is to be left-justified, e.g.:

library(outbreaks)
library(incidence2)

x <- ebola_sim_clean$linelist %>%
  incidence(date_index = date_of_onset, interval = "month")
plot(x) + scale_x_incidence(x, format = "%d %M %Y")
#> Scale for 'x' is already present. Adding another scale for 'x', which will
#> replace the existing scale.

I suspect most users will want to center the labels by default. It could be done by adding a center_labels = TRUE by default to scale_x_incidence, but this argument already exists with a different meaning (position of the tick marks) in the plot method.

One solution would be to:

  1. rename center_labels to center_tick in the plot method
  2. add a center_labels argument to scale_x_incidence

But I am sure there are other options - just can't think of a good one atm.

@thibautjombart thibautjombart added the FR / enhancement New feature or request label Sep 3, 2020
@TimTaylor
Copy link
Collaborator

closed with the v0.2.0 release 06d70b4. I've renamed center_labels to center_ticks and fixed a bug so the labels are centrally placed and nicely spaced for facets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FR / enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants