'How do I align the tick marks to the chart?

In this chart I have created, there is space between the tixk marks on the x axis and the x axis/chart. How can I put the tick marks closer to the x axis so that they align?

Solution 1:[1]
It would be better if you could supply your code and sample data, but try adding coord_cartesian(expand = FALSE) per my made-up example 2. Per example 1, I'm wondering if the zero line is not actually your x axis.
library(tidyverse)
tibble(x = rep(1:5, 2), y = 0:9) |>
ggplot(aes(x, y)) +
geom_line()

tibble(x = rep(1:5, 2), y = 0:9) |>
ggplot(aes(x, y)) +
geom_line() +
coord_cartesian(expand = FALSE)

Created on 2022-05-20 by the reprex package (v2.0.1)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Carl |
