如何在 ggline 图中叠加数据点

问题描述 投票:0回答:0

我用不同的线条创建了一个 ggplot:

enter image description here

此图的代码如下:

ggplot(binodalbet) +
  aes(x = w.sal, y = w.tpc, colour = Category) +
  geom_line() +
  geom_path(linewidth=1) +
  scale_color_hue(direction = 1) +
  labs(
    x = expression(w[Salt]),
    y = expression(w[TPC]),
    title = bquote(Bet~":"~2~LA~"/"~K[3]~PO[4])) +
    scale_color_discrete(name="") + 
    theme(panel.background = element_rect(fill = "white", colour = "grey50"), axis.text=element_text(size=20), title=element_text(size=24,face="bold"), legend.title=element_text(size=24, face="bold"),legend.text=element_text(size=22))

但是,我想要一组特定的点来覆盖图形)。

enter image description here

为此,我在单独构建时有以下情节:

enter image description here

ggplot(data=expbet, aes(x = w.sal, y = w.tpc)) + geom_point()

我想知道是否有办法将点点覆盖在另一个图上。

ggplot2 graph dot jitter
© www.soinside.com 2019 - 2024. All rights reserved.