Hi @martin.R, if you be so kind and have a look at reprex, please:
library(tidyverse)
library(magrittr)
boxLabels2 <- c("r1", "r2", "r3", "r4")
df2 <- data.frame(yAxis = boxLabels2, boxOdds = c(1.136, 3.000, 1.724, 5.909),
boxCILow = c(0.628, 1.216, 0.997, 2.485), boxCIHigh = c(2.056, 7.404, 2.981, 14.054),
p_values = c(0.673, 0.014, 0.051, 0.000))
df2$yAxis <- factor(df2$yAxis, levels = boxLabels2)
df2 %<>% mutate(p.value_Factor = if_else(
p_values < 0.05, "p < 0.05", "p > 0.05"
))
df2
#> yAxis boxOdds boxCILow boxCIHigh p_values p.value_Factor
#> 1 r1 1.136 0.628 2.056 0.673 p > 0.05
#> 2 r2 3.000 1.216 7.404 0.014 p < 0.05
#> 3 r3 1.724 0.997 2.981 0.051 p > 0.05
#> 4 r4 5.909 2.485 14.054 0.000 p < 0.05
p2 <- ggplot(df2, aes(y=yAxis)) +
geom_point(aes(x=boxOdds)) +
geom_segment(aes(x=boxCILow,xend=boxCIHigh,yend=yAxis))
p2 <- p2 + geom_vline(xintercept=1)
p2 + scale_x_continuous(breaks = seq(1,20, 1)) +
ylab("") +
xlab("Odds ratios") +
ggtitle("Odds ratios (OR) with 95% Confidence Interval")+
ylab("Symptoms")+
geom_vline(aes(xintercept = 1), size = .25, linetype = "dashed", color = "red")+
coord_trans(x = "log10") +
geom_text(data = df2, hjust = 0, vjust = -0.4, nudge_x = -0.2, size = 5,
aes(x = boxOdds, label = format(p_values, nsmall = 3), color = p_values > 0.05)) +
scale_colour_manual(values = c("red", "blue"))

and plot where your code was applied:
p2 + scale_x_continuous(breaks = seq(0.5,1, 0.5), seq(1,20, 1)) +
ylab("") +
xlab("Odds ratios") +
ggtitle("Odds ratios (OR) with 95% Confidence Interval")+
ylab("Symptoms")+
geom_vline(aes(xintercept = 1), size = .25, linetype = "dashed", color = "red")+
coord_trans(x = "log10") +
geom_text(data = df2, hjust = 0, vjust = -0.4, nudge_x = -0.2, size = 5,
aes(x = boxOdds, label = format(p_values, nsmall = 3), color = p_values > 0.05)) +
scale_colour_manual(values = c("red", "blue"))

Created on 2022-02-02 by the reprex package (v2.0.1)
I would like to have "something" on the left hand side of "1" on x-axis. In order to do this I use: seq(0.5,1, 0.5), this is enough for the left hand side and after "1" I would like seq(1,20, 1) as I do not need so small spaces between brakes. My additional question is why on the upper plot the more to the right on the x-axis the breaks are becoming more squeezed .
Kind regards,
Andrzej