scales icon indicating copy to clipboard operation
scales copied to clipboard

minor_breaks_n uses the limits instead of major breaks

Open JohnADawson opened this issue 8 months ago • 0 comments

Minor breaks ought to be evenly spaced, but in the following example they are not, because 10 minor breaks are put between 0 and the left limit, instead of the previous major break, -5, and, similarly, 10 minor breaks are put between 20 and the right limit, instead of the next major break, 25.

tibble::tibble(x = c(0., 20.)) |>
  ggplot2::ggplot(ggplot2::aes(.data$x)) +
  ggplot2::scale_x_continuous(minor_breaks = scales::minor_breaks_n(10L))

Image

JohnADawson avatar May 01 '25 08:05 JohnADawson