I am unable to reproduce the problem.
Please see How to make a great R reproducible example and provide the necessary code to reproduce the issue, then we can provide potential solutions.
library(tidyverse)
library(palmerpenguins)
library(ggpubr)
p1 <- penguins %>%
na.omit() %>%
ggplot(aes(x = flipper_length_mm,
y = bill_length_mm / max(bill_length_mm),
colour = island)) +
geom_line() +
theme_minimal(base_size = 16) +
theme(panel.grid.major.x = element_blank(),
panel.grid.minor.x = element_blank(),
panel.grid.minor.y = element_blank())
p2 <- penguins %>%
na.omit() %>%
ggplot(aes(x = bill_depth_mm,
y = bill_length_mm / max(bill_length_mm),
colour = island)) +
geom_line() +
theme_minimal(base_size = 16) +
theme(panel.grid.major.x = element_blank(),
panel.grid.minor.x = element_blank(),
panel.grid.minor.y = element_blank())
ggarrange(p1, p2)

ggarrange(p1, p2, common.legend = TRUE)
