Setting the x & y ticks to a sequential

Hi everyone,

I have a plot in which I'd like the xticks to be seq(0, 240, 24). I've tried many ways but surprisingly none of them worked.
If you got a solution, your help is much appreciated

Thanks :slightly_smiling_face::slightly_smiling_face:

Use the breaks argument to ggplot2::scale_x_continuous like so:

library(tidyverse)

mtcars %>% 
    ggplot(aes(x = disp, y = hp)) + 
    geom_point() +
    scale_x_continuous(
        breaks = seq( 
            from = 0, # Adjust the from, to, and by arguments as needed
            to = 500,
            by = 20
        )
    )

2 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.