我正在尝试使用 ggplot2 创建并标记散点图。我绘制的变量均经过缩放,以便水平轴和垂直轴以标准差为单位绘制(相对于平均值的 1、2、3、4...等)。我希望能够做的是仅标记那些超出平均值标准差一定限制的元素。理想情况下,该标签将基于另一列数据。
有办法做到这一点吗?
我浏览了在线手册,但找不到任何有关为绘制数据定义标签的信息。
感谢帮助!
谢谢!
BEB
I'm trying to use ggplot2 to create and label a scatterplot. The variables that I am plotting are both scaled such that the horizontal and the vertical axis are plotted in units of standard deviation (1,2,3,4,...ect from the mean). What I would like to be able to do is label ONLY those elements that are beyond a certain limit of standard deviations from the mean. Ideally, this labeling would be based off of another column of data.
Is there a way to do this?
I've looked through the online manual, but I haven't been able to find anything about defining labels for plotted data.
Help is appreciated!
Thanks!
BEB
发布评论
评论(3)
使用子集化:
Use subsetting:
标签可以通过以下方式完成:
The labeling can be done in the following way:
在 ggplot 函数之外进行子集化:
使用 qplot:
Subsetting outside of the ggplot function:
Using qplot: