【发布时间】:2017-06-23 18:24:04
【问题描述】:
全部,
为了在多个组(类别)中绘制数据:
data(iris)
library(dplyr)
iris_new <- select(iris, -Species)
ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width)) +
geom_point(data = iris_new, colour = "grey70") +
geom_point(aes(colour = Species)) +
facet_wrap(~Species)
我以前没有制作交互式绘图,但我想知道一种方法可以让我交互式地制作上图。例如,我不想使用facet 显示数据,而是想要一个类似底部的东西或向下滚动列表功能,我可以点击它以交互方式突出显示不同组的数据。每次单击某个组名(如用于图例的组名)时,我可以看到组数据突出显示,而其他数据显示为灰色。这里有什么想法吗?谢谢。
【问题讨论】:
-
你考虑过阴谋吗? plot.ly/ggplot2
标签: r plot ggplot2 interactive