识别散点图(qplot)中的点 [英] Identify points in Scatterplot (qplot)

查看:423
本文介绍了识别散点图(qplot)中的点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以识别(意味着:显示观察值)散点图中的某些点(使用qplot()),比如 identify 对于plot()?



最好的问候,Sarah

解决方案

试试通过我上面提供的链接进行修改

ggplot(dat,aes(x,y))+ geom_point()+
geom_text(data = dat,aes(x,y,label = label),hjust = 2)


Is there a way to identify (means: show the observation number) some points in a Scatterplot (using qplot()) such as identify does for plot()?

Best regards, Sarah

解决方案

Try this modified from the link I provided above

dat <- data.frame(x = rnorm(10), y = rnorm(10), label = seq(1:10))
ggplot(dat, aes(x,y)) + geom_point() +
  geom_text(data = dat, aes(x,y, label = label), hjust = 2)

这篇关于识别散点图(qplot)中的点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆