【发布时间】:2014-08-17 14:21:14
【问题描述】:
是否可以使用 rcharts 绘制具有平滑曲线和置信区间的散点图?
我可以用 ggvis 或 ggplot2 做到这一点,但我认为 rcharts 图形总体上看起来更好。
这是一个 ggvis 的例子
library(ggvis)
mtcars %>%
ggvis(~wt, ~mpg) %>%
layer_points() %>%
layer_model_predictions(model = "lm", se = TRUE)
这与 ggplot2
library(ggplot2)
c <- ggplot(mtcars, aes(wt, mpg))
c + stat_smooth() + geom_point()
谢谢!
【问题讨论】:
-
你最喜欢哪个库?我正在为 rCharts + 酒窝添加图层功能。
-
rcharts>ggplot2>ggvis.但这可能会迅速改变。我对 ggplot2 比较熟悉,而我几乎没有使用过其他的。当我能够使用 rcharts 创建图表时,我喜欢最终结果。
标签: r scatter-plot rcharts