我正在尝试创建一个图表,我对它几乎很满意。我只想更改 x 轴的限制(对数刻度)。我试图在 scale_x_continuous 中设置限制,但这会导致一条直线,而不是十条 S 曲线。到目前为止,我的代码是:
library("ggplot2")
ggplot(evaporation, aes(x = evaporation$h)) +
geom_line(aes(y = C1_theta, color = "blue"), size = 1.1) +
geom_line(aes(y = C2_theta, color = "blue"), size = 1.1) +
geom_line(aes(y = C3_theta, color = "blue"), size = 1.1) +
geom_line(aes(y = C4_theta, color = "blue"), size = 1.1) +
geom_line(aes(y = C5_theta, color = "blue"), size = 1.1) +
geom_line(aes(y = S1_theta, color = "green"), size = 1.1) +
geom_line(aes(y = S2_theta, color = "green"), size = 1.1) +
geom_line(aes(y = S3_theta, color = "green"), size = 1.1) +
geom_line(aes(y = S4_theta, color = "green"), size = 1.1) +
geom_line(aes(y = S5_theta, color = "green"), size = 1.1) +
scale_x_continuous(trans = "log", breaks = c(0, 10, 100, 1000, 10000, 100000), limits = 0, 100000) +
theme_bw() +
labs(y = expression(theta ~ (cm^3/cm^3)), x = "Absolute Pressure Head h (cm)") +
scale_color_manual(name = "Samples",
labels = c("Control sample", "Treated sample"),
values = c("#4472C4", "#70AD47")) +
theme(legend.position = c(0.82, 0.72), legend.direction = "vertical", legend.background = element_rect(colour = "black", linetype = "solid"))
有谁知道如何确保 x 轴停在 100000 处?