答案 0 :(得分:3)
library(ggplot2)
ggplot(mtcars, aes(wt, mpg)) +
geom_line() +
geom_segment(aes(x = 2, y = 0, xend = 2, yend = 25), linetype=2) +
geom_segment(aes(x = 0, y = 25, xend = 2, yend = 25), linetype=2) +
geom_point(data=data.frame(lat = c(25), long = c(2)),aes(long,lat),colour="blue",size=4) +
geom_segment(aes(x = 1, y = 0, xend = 1, yend = 20), linetype=2) +
geom_segment(aes(x = 0, y = 20, xend = 1, yend = 20), linetype=2) +
geom_point(data=data.frame(lat = c(20), long = c(1)),aes(long,lat),colour="blue",size=4)
您使用geom_segment和/或geom_point。
查看here有关如何更改轴标签/刻度的信息。
编辑:为了第二点,我编辑了我的帖子。